From ffb9e9051c12e71000ffe9d662175d1e211b9e0c Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Thu, 9 Nov 2023 11:37:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../store/order/StoreOrderRepository.php | 2 +- .../api/store/order/StoreOrderBehalf.php | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/app/common/repositories/store/order/StoreOrderRepository.php b/app/common/repositories/store/order/StoreOrderRepository.php index df25058e..55d842a0 100644 --- a/app/common/repositories/store/order/StoreOrderRepository.php +++ b/app/common/repositories/store/order/StoreOrderRepository.php @@ -1808,7 +1808,7 @@ class StoreOrderRepository extends BaseRepository unset($order['takeOrderList'], $order->interest); } - return compact( 'count','list', 'where'); + return compact( 'count','list'); } public function getOrderStatusV2($order) { diff --git a/app/controller/api/store/order/StoreOrderBehalf.php b/app/controller/api/store/order/StoreOrderBehalf.php index 92be27bb..7c08dc38 100644 --- a/app/controller/api/store/order/StoreOrderBehalf.php +++ b/app/controller/api/store/order/StoreOrderBehalf.php @@ -73,17 +73,17 @@ class StoreOrderBehalf extends BaseController $mer_id = Db::name('store_service')->where('uid', $uid)->where('is_del', 0)->value('mer_id'); if ($mer_id) { if($status=='all'){ - $where[]=['status','>=',0]; + $where['status']=['>=',0]; }else{ - $where[]=['status','=',$status]; + $where['status']=['=',$status]; } $column = Db::name('store_order_behalf')->where('mer_id', $mer_id)->where($where)->page($page)->limit($limit)->column('order_id'); if ($column) { $where['order_id'] = $column; if($status==0){ - $where[]=['status','=',2]; + $where['status']=2; }elseif($status==1){ - $where[]=['status','=',3]; + $where['status']=3; } return app('json')->success($this->repository->getList($where, 1, 100)); } @@ -138,8 +138,12 @@ class StoreOrderBehalf extends BaseController $uid = $this->request->userInfo()['uid']; $mer_id = Db::name('store_service')->where('uid', $uid)->where('is_del', 0)->value('mer_id'); if ($mer_id) { - $noPostage = Db::name('store_order_behalf')->where('mer_id', $mer_id)->where('status',0)->count(); - $noDeliver = Db::name('store_order_behalf')->where('mer_id', $mer_id)->where('status',1)->count(); + $noPostage = Db::name('store_order_behalf')->where('mer_id', $mer_id)->where('status',0) + ->join('store_order', 'store_order.status = 0') + ->count(); + $noDeliver = Db::name('store_order_behalf')->where('mer_id', $mer_id)->where('status',1) + ->join('store_order', 'store_order.status = 1') + ->count(); } return app('json')->success(compact('noDeliver', 'noPostage',));