Accept Merge Request #203: (feature/hant -> develop)

Merge Request: 派单时效

Created By: @todayswind
Accepted By: @todayswind
URL: https://g-bcrc3009.coding.net/p/allocatr/d/allocatr/git/merge/203?initial=true
This commit is contained in:
todayswind 2025-07-01 11:32:28 +08:00 committed by Coding
commit 16b65a1fcd

View File

@ -81,6 +81,8 @@ class Item extends Backend
'sum(material_cost) material_cost', // 收益
'sum(refund_amount) 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')
->order('count_num', 'desc');
// dd($total);
@ -100,7 +102,7 @@ class Item extends Backend
$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['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['id'] = $re['item_id'];
$data [] = $re;