sb
This commit is contained in:
parent
d619f3a376
commit
25a38ed146
|
|
@ -137,6 +137,8 @@ class Dispatcher extends Backend
|
|||
// 使用 IFNULL 确保结果为 null 时返回 0
|
||||
"IFNULL(COUNT(CASE WHEN status = 60 THEN 1 END), 0) AS finish_num", //完成数
|
||||
"IFNULL(COUNT(CASE WHEN status IN (".$orderValid.") THEN 1 END), 0) AS count_num", //总订单数 (排除取消 和草稿)
|
||||
"IFNULL(COUNT(CASE WHEN is_overtime = 1 THEN 1 END), 0) AS overtime_num", //超时数
|
||||
|
||||
"IFNULL(SUM(CASE WHEN status = 60 THEN total END), 0) AS total", //成效额
|
||||
"IFNULL(SUM(CASE WHEN status = 60 THEN performance END), 0) AS performance", //业绩
|
||||
"IFNULL(SUM(CASE WHEN status = 60 THEN (cost + material_cost) END), 0) AS cost_total", //总成本
|
||||
|
|
@ -196,6 +198,8 @@ class Dispatcher extends Backend
|
|||
$datum->performance_avg = $this->_calc($datum->performance,$datum->finish_num,2);
|
||||
//客单价 = 总成效额 / 完单数
|
||||
$datum->total_avg = $this->_calc($datum->total,$datum->finish_num,2);
|
||||
//超时率
|
||||
$datum->overtime_rate = $this->_calc($datum->overtime_num,$datum->count_num,4,true);
|
||||
|
||||
if(!empty($datum->dispatch_admin_id)){
|
||||
$datum->admin_user = Admin::where('id',$datum->dispatch_admin_id)->value('nickname')??'系统';
|
||||
|
|
|
|||
|
|
@ -46,6 +46,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'echarts', 'echarts-t
|
|||
{field: 'total_avg', title: __('客单价(¥)'), operate: false},
|
||||
|
||||
{field: 'avg_time_diff', title: __('派单时效(小时)'), operate: false},
|
||||
{field: 'overtime_num', title: __('派单超时数'), operate: false},
|
||||
{field: 'overtime_rate', title: __('派单超时率(%)'), operate: false},
|
||||
|
||||
//{field: 'admin_user', title: __('派单员'),operate: "LIKE",visible:false},
|
||||
//{field: 'city_name', title: __('城市'),operate: "LIKE",visible:false},
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user