From c92f8a72b6f83bdf9cff8814681228d3e3f69539 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Wed, 26 Jun 2024 14:52:20 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E9=97=A8=E5=BA=97=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/store_order/StoreOrderLogic.php | 3 +++ .../store_order/StoreOrderController.php | 6 +++--- app/store/lists/store_order/StoreOrderLists.php | 16 ++++++++++++++++ 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/app/common/logic/store_order/StoreOrderLogic.php b/app/common/logic/store_order/StoreOrderLogic.php index 4d2e5830f..da9cf0212 100644 --- a/app/common/logic/store_order/StoreOrderLogic.php +++ b/app/common/logic/store_order/StoreOrderLogic.php @@ -288,6 +288,9 @@ class StoreOrderLogic extends BaseLogic */ public function storeOrderCount($storeId, $status, $paid = 1) { + if(empty($storeId)){ + return StoreOrder::where(['status' => $status, 'paid' => $paid])->count(); + } return StoreOrder::where(['store_id' => $storeId, 'status' => $status, 'paid' => $paid])->count(); } diff --git a/app/store/controller/store_order/StoreOrderController.php b/app/store/controller/store_order/StoreOrderController.php index d98768387..e7e587ccd 100644 --- a/app/store/controller/store_order/StoreOrderController.php +++ b/app/store/controller/store_order/StoreOrderController.php @@ -59,9 +59,9 @@ class StoreOrderController extends BaseAdminController 'pay_type' => PayEnum::getPaySceneDesc(), 'order_status' => [ 'wait_send' => $orderLogic->storeOrderCount($this->request->adminInfo['store_id'], 0), - 'to_be_paid' => $orderLogic->storeOrderCount($this->request->adminInfo['store_id'], 0, 0), - 'wait_receive' => $orderLogic->storeOrderCount($this->request->adminInfo['store_id'], 1), - 'finish' => $orderLogic->storeOrderCount($this->request->adminInfo['store_id'], 2), + 'to_be_paid' => $orderLogic->storeOrderCount(0, 0, 0), + 'wait_receive' => $orderLogic->storeOrderCount(0, 1), + 'finish' => $orderLogic->storeOrderCount(0, 2), ], ]); } diff --git a/app/store/lists/store_order/StoreOrderLists.php b/app/store/lists/store_order/StoreOrderLists.php index 59a98e78d..1eb00fe33 100644 --- a/app/store/lists/store_order/StoreOrderLists.php +++ b/app/store/lists/store_order/StoreOrderLists.php @@ -54,6 +54,22 @@ class StoreOrderLists extends BaseAdminDataLists implements ListsSearchInterface } elseif ($is_sashier == 2) { //小程序订单 $this->searchWhere[] = ['pay_type', 'in', [7, 3, 18,19]]; } + $status = $this->request->get('status',''); + $this->searchWhere[] = ['store_id', '=', $store_id]; + switch ($status){ + case -1: + $this->searchWhere[] = ['status', '=', 0]; + $this->searchWhere[] = ['paid', '=', 0]; + break; + case 1: + $this->searchWhere[] = ['status', '=', 1]; + break; + case 2: + $this->searchWhere[] = ['status', '=', 2]; + $this->searchWhere[] = ['paid', '=', 1]; + break; + } + return StoreOrder::where($this->searchWhere)->with(['user']) ->field(['id', 'order_id', 'pay_price', 'pay_time','uid', 'pay_type', 'status', 'paid', 'total_num']) ->limit($this->limitOffset, $this->limitLength) From 217bfec00e0ec0b9f221e249b322a59b5623de99 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Wed, 26 Jun 2024 14:53:21 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BA=97=E9=93=BA?= =?UTF-8?q?=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/store/lists/store_order/StoreOrderLists.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/store/lists/store_order/StoreOrderLists.php b/app/store/lists/store_order/StoreOrderLists.php index 1eb00fe33..542d75bb3 100644 --- a/app/store/lists/store_order/StoreOrderLists.php +++ b/app/store/lists/store_order/StoreOrderLists.php @@ -55,7 +55,6 @@ class StoreOrderLists extends BaseAdminDataLists implements ListsSearchInterface $this->searchWhere[] = ['pay_type', 'in', [7, 3, 18,19]]; } $status = $this->request->get('status',''); - $this->searchWhere[] = ['store_id', '=', $store_id]; switch ($status){ case -1: $this->searchWhere[] = ['status', '=', 0]; From 6bd47998902950a7e1887a365e2c0196cee0928e Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Wed, 26 Jun 2024 14:54:41 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=99=90=E5=88=B6?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/store/lists/store_order/StoreOrderLists.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/store/lists/store_order/StoreOrderLists.php b/app/store/lists/store_order/StoreOrderLists.php index 542d75bb3..416fc983a 100644 --- a/app/store/lists/store_order/StoreOrderLists.php +++ b/app/store/lists/store_order/StoreOrderLists.php @@ -62,6 +62,7 @@ class StoreOrderLists extends BaseAdminDataLists implements ListsSearchInterface break; case 1: $this->searchWhere[] = ['status', '=', 1]; + $this->searchWhere[] = ['paid', '=', 1]; break; case 2: $this->searchWhere[] = ['status', '=', 2];