From ffb34f001731a263cd102673031286462fc862f2 Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Thu, 29 Feb 2024 11:51:27 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"=E5=95=86=E6=88=B7=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=B4=AD=E4=B9=B0=E6=99=AE=E9=80=9A=E5=BA=97?= =?UTF-8?q?=E9=93=BA=E5=95=86=E5=93=81"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4290a872bea072d72806f9c687314858efaa5b73. --- app/common/dao/store/order/StoreCartDao.php | 12 ------------ app/common/dao/store/product/SpuDao.php | 11 ++++------- .../repositories/store/product/SpuRepository.php | 3 --- app/controller/api/store/merchant/Merchant.php | 3 --- 4 files changed, 4 insertions(+), 25 deletions(-) diff --git a/app/common/dao/store/order/StoreCartDao.php b/app/common/dao/store/order/StoreCartDao.php index 802be371..b9a61c85 100755 --- a/app/common/dao/store/order/StoreCartDao.php +++ b/app/common/dao/store/order/StoreCartDao.php @@ -71,16 +71,10 @@ class StoreCartDao extends BaseDao */ public function getAll(int $uid,$product_type,$source=0) { - if ($product_type == 98) { - $product_type = [98, 0]; - } $where=['uid' => $uid, 'is_del' => 0, 'is_new' => 0, 'is_pay' => 0,'product_type' => $product_type,'source'=>$source]; if($source==103){ $where=['uid' => $uid, 'is_del' => 0, 'is_new' => 0, 'is_pay' => 0,'source'=>$source]; } - if ($source == 12) { - $where['source'] = [0, 12]; - } $query = ($this->getModel())::where($where) ->with([ 'product' => function ($query) { @@ -158,16 +152,10 @@ class StoreCartDao extends BaseDao */ public function getCartCount(int $uid,$product_type,$source=0) { - if ($product_type == 98) { - $product_type = [98, 0]; - } $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]; } - if ($source == 12) { - $where['source'] = [0, 12]; - } $count = ($this->getModel()::getDB())->where($where)->count(); $data[0]['count'] = $count; return $data; diff --git a/app/common/dao/store/product/SpuDao.php b/app/common/dao/store/product/SpuDao.php index 840920a2..040e29bb 100755 --- a/app/common/dao/store/product/SpuDao.php +++ b/app/common/dao/store/product/SpuDao.php @@ -65,13 +65,7 @@ class SpuDao extends BaseDao $query->where('P.mer_id',$where['mer_id']); }) ->when(isset($where['product_type']) && $where['product_type'] !== '',function($query)use($where){ - if (is_array($where['product_type'])) { - $query->whereIn('P.product_type',$where['product_type']); - $query->whereIn('S.product_type',$where['product_type']); - } else { - $query->where('P.product_type',$where['product_type']); - $query->where('S.product_type',$where['product_type']); - } + $query->where('P.product_type',$where['product_type']); }) ->when(isset($where['mer_array_id']),function($query)use($where){ $query->whereIn('P.mer_id',$where['mer_array_id']); @@ -146,6 +140,9 @@ class SpuDao extends BaseDao ->when(isset($where['is_gift_bag']) && $where['is_gift_bag'] !== '',function($query)use($where){ $query->where('P.is_gift_bag',$where['is_gift_bag']); }) + ->when(isset($where['product_type']) && $where['product_type'] !== '',function($query)use($where){ + $query->where('S.product_type',$where['product_type']); + }) ->when(isset($where['action']) && $where['action'] !== '',function($query)use($where){ $query->where('S.product_type','>',0); }) diff --git a/app/common/repositories/store/product/SpuRepository.php b/app/common/repositories/store/product/SpuRepository.php index a0a33aa8..993e7a79 100755 --- a/app/common/repositories/store/product/SpuRepository.php +++ b/app/common/repositories/store/product/SpuRepository.php @@ -154,9 +154,6 @@ class SpuRepository extends BaseRepository if (!empty($this->orderField)) { $this->dao->orderField = $this->orderField; } - if ($where['product_type'] == 98) { - $where['product_type'] = [0, 98]; - } $query = $this->dao->search($where); $query->with([ diff --git a/app/controller/api/store/merchant/Merchant.php b/app/controller/api/store/merchant/Merchant.php index 0e9aee42..df132182 100755 --- a/app/controller/api/store/merchant/Merchant.php +++ b/app/controller/api/store/merchant/Merchant.php @@ -62,9 +62,6 @@ class Merchant extends BaseController if (empty($where['type_id'])) { $where['type_id'] = [10, 17]; } - if (!empty($where['type_id']) && $where['type_id'] == 12) { - $where['type_id'] = [10, 12, 17]; - } if ($where['merchant_category_id'] > 0) { // $arr= Db::name('store_category')->where(['pid'=>$where['store_category_id'],'mer_id'=>0,'level'=>1,'is_show'=>1])->column('cate_name'); // if($arr){