派单时效

This commit is contained in:
todaywindy 2025-07-01 11:31:32 +08:00
parent cdced64205
commit 0fbaccc7f9

View File

@ -81,6 +81,8 @@ class Item extends Backend
'sum(material_cost) material_cost', // 收益 'sum(material_cost) material_cost', // 收益
'sum(refund_amount) refund_amount', // 公司退款 'sum(refund_amount) refund_amount', // 公司退款
'sum(worker_refund_amount) worker_refund_amount', // 工人退款 'sum(worker_refund_amount) worker_refund_amount', // 工人退款
"IFNULL(AVG(CASE WHEN status > 10 THEN UNIX_TIMESTAMP(dispatch_time) - UNIX_TIMESTAMP(create_time) END), 0) AS avg_time_diff", //派单时效
])->group('item_title') ])->group('item_title')
->order('count_num', 'desc'); ->order('count_num', 'desc');
// dd($total); // dd($total);
@ -100,7 +102,7 @@ class Item extends Backend
$re['cash_value'] = $this->mydiv($re['performance'],$re['count_num'],2,false); $re['cash_value'] = $this->mydiv($re['performance'],$re['count_num'],2,false);
$re['total_avg'] = $this->mydiv($re['total'],$re['count_num'],2,false); $re['total_avg'] = $this->mydiv($re['total'],$re['count_num'],2,false);
$re['performance_avg'] = $this->mydiv($re['performance'],$re['finish_num'],2,false); $re['performance_avg'] = $this->mydiv($re['performance'],$re['finish_num'],2,false);
$re['avg_time_diff'] = $this->mydiv($re['avg_time_diff'],3600,2,false);
$re['cost_total'] = $cost_total; $re['cost_total'] = $cost_total;
// $re['id'] = $re['item_id']; // $re['id'] = $re['item_id'];
$data [] = $re; $data [] = $re;