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

Merge Request: 服务统计

Created By: @todayswind
Accepted By: @todayswind
URL: https://g-bcrc3009.coding.net/p/allocatr/d/allocatr/git/merge/218?initial=true
This commit is contained in:
todayswind 2025-07-10 18:21:07 +08:00 committed by Coding
commit 6a8e8055b1

View File

@ -86,6 +86,8 @@ class Item extends Backend
public function list() public function list()
{ {
$build = new Order(); $build = new Order();
[$where, $sort, $order, $offset, $limit] = $this->buildparams();
$start = now()->modify('-7 days')->format('Y-m-d'); $start = now()->modify('-7 days')->format('Y-m-d');
$end_at = now()->format('Y-m-d 23:29:59'); $end_at = now()->format('Y-m-d 23:29:59');
@ -139,7 +141,7 @@ class Item extends Backend
])->group('item_title') ])->group('item_title')
->order('count_num', 'desc'); ->order('count_num', 'desc');
// dd($total); // dd($total);
$res = $build->paginate(); $res = $build->paginate($limit);
$total = $res->total(); $total = $res->total();
$ress = $res->items(); $ress = $res->items();
$data = []; $data = [];
@ -156,7 +158,7 @@ class Item extends Backend
$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['avg_time_diff'] = $this->mydiv($re['avg_time_diff'],3600,2,false);
$re['cost_total'] = $cost_total; $re['cost_total'] = number_format($cost_total,2,'.','');
// $re['id'] = $re['item_id']; // $re['id'] = $re['item_id'];
$data [] = $re; $data [] = $re;
} }