diff --git a/app/common/dao/store/order/StoreCartDao.php b/app/common/dao/store/order/StoreCartDao.php index b9a61c85..802be371 100755 --- a/app/common/dao/store/order/StoreCartDao.php +++ b/app/common/dao/store/order/StoreCartDao.php @@ -71,10 +71,16 @@ 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) { @@ -152,10 +158,16 @@ 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 040e29bb..840920a2 100755 --- a/app/common/dao/store/product/SpuDao.php +++ b/app/common/dao/store/product/SpuDao.php @@ -65,7 +65,13 @@ class SpuDao extends BaseDao $query->where('P.mer_id',$where['mer_id']); }) ->when(isset($where['product_type']) && $where['product_type'] !== '',function($query)use($where){ - $query->where('P.product_type',$where['product_type']); + 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']); + } }) ->when(isset($where['mer_array_id']),function($query)use($where){ $query->whereIn('P.mer_id',$where['mer_array_id']); @@ -140,9 +146,6 @@ 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 993e7a79..a0a33aa8 100755 --- a/app/common/repositories/store/product/SpuRepository.php +++ b/app/common/repositories/store/product/SpuRepository.php @@ -154,6 +154,9 @@ 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 df132182..0e9aee42 100755 --- a/app/controller/api/store/merchant/Merchant.php +++ b/app/controller/api/store/merchant/Merchant.php @@ -62,6 +62,9 @@ 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){