统计
This commit is contained in:
parent
f8d544d12f
commit
5b225c0238
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user