From 5b225c023843285c4cb203c657994c092f42d203 Mon Sep 17 00:00:00 2001 From: hant Date: Sun, 3 Aug 2025 20:45:53 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/statistics/Item.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/application/admin/controller/statistics/Item.php b/application/admin/controller/statistics/Item.php index 1acb235..bacce61 100644 --- a/application/admin/controller/statistics/Item.php +++ b/application/admin/controller/statistics/Item.php @@ -96,7 +96,7 @@ class Item extends Backend if (!empty($filter)){ $arr = explode(' - ', $filter); if (trim($arr[0])) { - $start = trim($arr[0]); + $start = trim($arr[0]). ' 00:00:00'; } if (trim($arr[1])) { $end_at = trim($arr[1]) . ' 23:29:59'; @@ -113,10 +113,6 @@ class Item extends Backend if(!empty(request()->get('source',null))){ $build->where('source',request()->get('source')); } - //城市 - /* if(!empty(request()->post('area_id',null))){ - $build->where('area_id','LIKE',request()->post('source').'%'); - }*/ if(!empty(request()->get('item_id',null))){ $item_id =request()->get('item_id'); @@ -125,7 +121,8 @@ class Item extends Backend $build->whereIn('item_id', $item_ids); } - $build->whereBetween('create_time', [$start, $end_at]) + $build->whereBetween('audit_time', [$start, $end_at]) + ->where('status',Order::STATUS_FINISHED) ->field([ 'item_title name', // 类型 'sum(total) total', // 营业额 @@ -141,6 +138,7 @@ class Item extends Backend ])->group('item_title') ->order('count_num', 'desc'); // dd($total); + $res = $build->paginate($limit); $total = $res->total(); $ress = $res->items();