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',));