From a6de7e2ea97ed0d56e28ae676c6785054e7b09d8 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Thu, 4 Jan 2024 18:42:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + app/common/dao/store/order/StoreCartDao.php | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 7208e679..f609c241 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ /.vscode *.log .env +.example.env .user.ini .phpstorm.meta.php .constant diff --git a/app/common/dao/store/order/StoreCartDao.php b/app/common/dao/store/order/StoreCartDao.php index 25f117ea..b9a61c85 100644 --- a/app/common/dao/store/order/StoreCartDao.php +++ b/app/common/dao/store/order/StoreCartDao.php @@ -87,7 +87,6 @@ class StoreCartDao extends BaseDao $query->field('mer_id,mer_name,mer_state,mer_avatar,is_trader,type_id,credit_buy,street_id')->with(['type_names']); } ])->select(); - return $query; } @@ -153,7 +152,11 @@ class StoreCartDao extends BaseDao */ public function getCartCount(int $uid,$product_type,$source=0) { - $count = ($this->getModel()::getDB())->where(['uid' => $uid, 'is_del' => 0, 'is_new' => 0, 'is_pay' => 0,'product_type' => $product_type,'is_fail'=>0,'source'=>$source])->count(); + $where=['uid' => $uid, 'is_del' => 0, 'is_new' => 0, 'is_pay' => 0,'product_type' => $product_type,'is_fail'=>0,'source'=>$source]; + if($source==103){ + $where=['uid' => $uid, 'is_del' => 0, 'is_new' => 0, 'is_pay' => 0,'is_fail'=>0,'source'=>$source]; + } + $count = ($this->getModel()::getDB())->where($where)->count(); $data[0]['count'] = $count; return $data; }