From dd5448a9763d54e3072b8b8b5339daa35e454ccb Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Wed, 16 Aug 2023 15:56:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=BB=9F=E8=AE=A1number?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/dao/store/order/StoreOrderDao.php | 18 +++++++++++++----- .../store/order/StoreOrderRepository.php | 12 ++++++------ 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/app/common/dao/store/order/StoreOrderDao.php b/app/common/dao/store/order/StoreOrderDao.php index e96cac89..c5f0e89b 100644 --- a/app/common/dao/store/order/StoreOrderDao.php +++ b/app/common/dao/store/order/StoreOrderDao.php @@ -98,25 +98,33 @@ class StoreOrderDao extends BaseDao ->when(isset($where['status']) && $where['status'] !== '', function ($query) use ($where) { switch ($where['status']) { case 0 : - $query->where('paid', 0)->whereIn('StoreOrder.status', [0, 9, 12]); + $query->where('paid', 1)->whereIn('StoreOrder.status', [0, 9, 12]); + break; + case 1 : + $query->where('paid', 1)->where('StoreOrder.status', 1); + break; + case 2 : + $query->where('paid', 1)->where('StoreOrder.status', 2)->where('pay_type', '<>', StoreGroupOrder::PAY_TYPE_CREDIT_BUY); + break; + case 3 : + $query->where('paid', 1)->where('StoreOrder.status', 1); break; case 4 : $query->where('paid', 1)->whereIn('StoreOrder.status', [0, 9, 12]); break; + case -1 : + $query->where('paid', 0)->whereIn('StoreOrder.status', [0, 9, 12]); case -2 : $query->whereNotIn('StoreOrder.status', [10, 11]); break; case 10 : $query->where('paid', 1)->whereIn('StoreOrder.status', [10, 11]); break; - case 2 : - $query->where('paid', 1)->where('StoreOrder.status', $where['status'])->where('pay_type', '<>', StoreGroupOrder::PAY_TYPE_CREDIT_BUY); - break; case 20 : $query->where('paid', 1)->whereIn('StoreOrder.status', [2, 3]); break; default: - $query->where('paid', 1)->where('StoreOrder.status', $where['status']); + // $query->where('paid', 1)->where('StoreOrder.status', $where['status']); break; } }) diff --git a/app/common/repositories/store/order/StoreOrderRepository.php b/app/common/repositories/store/order/StoreOrderRepository.php index 344b453e..7196f20f 100644 --- a/app/common/repositories/store/order/StoreOrderRepository.php +++ b/app/common/repositories/store/order/StoreOrderRepository.php @@ -585,11 +585,11 @@ class StoreOrderRepository extends BaseRepository if ($product_type == 98) { $isUser = 0; } - $noPay = $this->dao->search(['uid' => $uid, 'status' => 0, 'paid' => 0, 'is_user' => $isUser])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->fetchSql(false)->count(); - $noPostage = $this->dao->search(['uid' => $uid, 'status' => 4, 'paid' => 1, 'is_user' => $isUser])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->fetchSql(false)->count(); - $noDeliver = $this->dao->search(['uid' => $uid, 'status' => 1, 'paid' => 1, 'is_user' => $isUser])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->fetchSql(false)->count(); - $noComment = $this->dao->search(['uid' => $uid, 'status' => 2, 'paid' => 1, 'is_user' => $isUser])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->fetchSql(false)->count(); - $done = $this->dao->search(['uid' => $uid, 'status' => 3, 'paid' => 1, 'is_user' => $isUser])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->fetchSql(false)->count(); + $noPay = $this->dao->search(['uid' => $uid, 'status' => -1, 'is_user' => $isUser])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->fetchSql(false)->count(); + $noPostage = $this->dao->search(['uid' => $uid, 'status' => 0, 'is_user' => $isUser])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->fetchSql(false)->count(); + $noDeliver = $this->dao->search(['uid' => $uid, 'status' => 1, 'is_user' => $isUser])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->fetchSql(false)->count(); + $noComment = $this->dao->search(['uid' => $uid, 'status' => 2, 'is_user' => $isUser])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->fetchSql(false)->count(); + $done = $this->dao->search(['uid' => $uid, 'status' => 3, 'is_user' => $isUser])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->fetchSql(false)->count(); $refund = StoreRefundOrder::alias('t1')->join('store_order t2', 't1.order_id=t2.order_id')->where('t1.uid', $uid)->where('t1.status', 3)->where('t2.activity_type', $product_type)->count(); //$all = $this->dao->search(['uid' => $uid, 'status' => -2,'is_user' => 1])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->count(); $orderPrice = $this->dao->search(['uid' => $uid, 'paid' => 1, 'is_user' => $isUser])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->fetchSql(false)->sum('pay_price'); @@ -1736,7 +1736,7 @@ class StoreOrderRepository extends BaseRepository unset($order['takeOrderList'], $order->interest); } - return compact( 'count','list'); + return compact( 'count','list', 'where'); } public function userList($uid, $page, $limit)