From 4b2c385b8bc3484bad9ef9f592bd456aa64cecdc Mon Sep 17 00:00:00 2001
From: mkm <727897186@qq.com>
Date: Sat, 3 Aug 2024 11:37:11 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E6=9F=A5=E8=AF=A2?=
 =?UTF-8?q?=E5=B7=B2=E6=94=AF=E4=BB=98=E8=AE=A2=E5=8D=95=E7=9A=84=E6=9D=A1?=
 =?UTF-8?q?=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../store_order_cart_info/StoreOrderCartInfoGroupLists.php      | 2 ++
 .../lists/store_order_cart_info/StoreOrderCartInfoTwoLists.php  | 2 ++
 app/common/logic/PayNotifyLogic.php                             | 1 +
 3 files changed, 5 insertions(+)

diff --git a/app/admin/lists/store_order_cart_info/StoreOrderCartInfoGroupLists.php b/app/admin/lists/store_order_cart_info/StoreOrderCartInfoGroupLists.php
index 37153b05..20d36225 100644
--- a/app/admin/lists/store_order_cart_info/StoreOrderCartInfoGroupLists.php
+++ b/app/admin/lists/store_order_cart_info/StoreOrderCartInfoGroupLists.php
@@ -52,6 +52,8 @@ class StoreOrderCartInfoGroupLists extends BaseAdminDataLists implements ListsSe
         if($this->request->get('start_time')==''){
             $this->searchWhere[]=['create_time','between',[strtotime(date('Y-m-d 00:00:00')),strtotime(date('Y-m-d 23:59:59'))]];
         }
+        $this->searchWhere[]=['is_pay','=',1];
+        $this->searchWhere[]=['status','>=',0];
         return StoreOrderCartInfo::where($this->searchWhere)
             ->field('product_id,price,SUM(total_price) as total_price,SUM(cart_num) as cart_num')->group('product_id')
             ->limit($this->limitOffset, $this->limitLength)
diff --git a/app/admin/lists/store_order_cart_info/StoreOrderCartInfoTwoLists.php b/app/admin/lists/store_order_cart_info/StoreOrderCartInfoTwoLists.php
index 2a8557d5..468e3ee9 100644
--- a/app/admin/lists/store_order_cart_info/StoreOrderCartInfoTwoLists.php
+++ b/app/admin/lists/store_order_cart_info/StoreOrderCartInfoTwoLists.php
@@ -52,6 +52,8 @@ class StoreOrderCartInfoTwoLists extends BaseAdminDataLists implements ListsSear
         if ($this->request->get('start_time') == '') {
             $this->searchWhere[] = ['create_time', 'between', [strtotime(date('Y-m-d 00:00:00')), strtotime(date('Y-m-d 23:59:59'))]];
         }
+        $this->searchWhere[]=['is_pay','=',1];
+        $this->searchWhere[]=['status','>=',0];
         $query = StoreOrderCartInfo::where($this->searchWhere);
         if ($this->request->get('is_group') == 1) {
             $query->field('store_id,product_id,price,SUM(total_price) as total_price,SUM(cart_num) as cart_num')->group(['store_id', 'product_id']);
diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php
index f0d160fc..d1c8d5cd 100644
--- a/app/common/logic/PayNotifyLogic.php
+++ b/app/common/logic/PayNotifyLogic.php
@@ -563,6 +563,7 @@ class PayNotifyLogic extends BaseLogic
      */
     public static function afterPay($order, $transaction_id = 0)
     {
+        StoreOrderCartInfo::where('oid', $order['id'])->update(['is_pay' => 1]);
         $financeLogic = new StoreFinanceFlowLogic();
         $off_activity = Config::where('name', 'off_activity')->value('value');
         $village_uid = 0;