修改店铺订单查询
This commit is contained in:
parent
e5208db56d
commit
16586fd5e7
@ -60,11 +60,8 @@ class StoreOrderLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
$query->where('store_id', '=', $this->request->adminInfo['store_id']);
|
||||
})
|
||||
->when(!empty($this->params['status']), function ($query) {
|
||||
if (is_array($this->params['status'])) {
|
||||
$query->whereIn('status', $this->params['status']);
|
||||
} else {
|
||||
$query->where('status', $this->params['status']);
|
||||
}
|
||||
$status = explode(',', $this->params['status']);
|
||||
$query->whereIn('status', $status);
|
||||
})
|
||||
->field(['id', 'store_id', 'staff_id', 'order_id', 'pay_price', 'pay_time', 'pay_type', 'status', 'uid'])
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
@ -93,9 +90,6 @@ class StoreOrderLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
public function count(): int
|
||||
{
|
||||
return StoreOrder::where($this->searchWhere)
|
||||
->when(!empty($this->request->adminInfo['store_id']), function ($query) {
|
||||
$query->where('store_id', '=', $this->request->adminInfo['store_id']);
|
||||
})
|
||||
->when(!empty($this->params['start_time']), function ($query) {
|
||||
$query->whereTime('create_time', '>=', $this->params['start_time']);
|
||||
})
|
||||
@ -105,6 +99,13 @@ class StoreOrderLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
}
|
||||
$query->whereTime('create_time', '<=', $this->params['end_time']);
|
||||
})
|
||||
->when(!empty($this->request->adminInfo['store_id']), function ($query) {
|
||||
$query->where('store_id', '=', $this->request->adminInfo['store_id']);
|
||||
})
|
||||
->when(!empty($this->params['status']), function ($query) {
|
||||
$status = explode(',', $this->params['status']);
|
||||
$query->whereIn('status', $status);
|
||||
})
|
||||
->count();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user