feat(StoreOrderLists): 根据收银台和小程序订单调整查询条件

This commit is contained in:
mkm 2024-07-05 18:58:28 +08:00
parent 98e93b0f69
commit 1fd70503c0

View File

@ -48,8 +48,8 @@ class StoreOrderLists extends BaseAdminDataLists implements ListsSearchInterface
{ {
$store_id = $this->adminInfo['store_id'] ?? 5; $store_id = $this->adminInfo['store_id'] ?? 5;
$is_sashier = $this->request->get('is_sashier'); $is_sashier = $this->request->get('is_sashier');
$this->searchWhere[] = ['store_id', '=', $store_id];
if ($is_sashier == 1) { //收银台订单 if ($is_sashier == 1) { //收银台订单
$this->searchWhere[] = ['store_id', '=', $store_id];
$this->searchWhere[] = ['source', '=', 1]; $this->searchWhere[] = ['source', '=', 1];
} elseif ($is_sashier == 2) { //小程序订单 } elseif ($is_sashier == 2) { //小程序订单
$this->searchWhere[] = ['source', '=', 0]; $this->searchWhere[] = ['source', '=', 0];
@ -74,7 +74,7 @@ class StoreOrderLists extends BaseAdminDataLists implements ListsSearchInterface
->field(['id', 'order_id', 'pay_price', 'pay_time','uid', 'pay_type', 'status', 'paid', 'total_num']) ->field(['id', 'order_id', 'pay_price', 'pay_time','uid', 'pay_type', 'status', 'paid', 'total_num'])
->limit($this->limitOffset, $this->limitLength) ->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc']) ->order(['id' => 'desc'])
->select()->each(function ($item) use ($store_id) { ->select()->each(function ($item){
if (empty($item['pay_time'])) { if (empty($item['pay_time'])) {
$item['pay_time'] = ''; $item['pay_time'] = '';
}else{ }else{