diff --git a/app/common/dao/store/product/SpuDao.php b/app/common/dao/store/product/SpuDao.php index 69d61e3b..8b971dd0 100644 --- a/app/common/dao/store/product/SpuDao.php +++ b/app/common/dao/store/product/SpuDao.php @@ -89,6 +89,9 @@ class SpuDao extends BaseDao ])->column('mer_id'); $query->whereIn('P.mer_id',$merId); }) + ->when(isset($where['is_good']) && $where['is_good'] !== '',function($query)use($where){ + $query->where('P.is_good',$where['is_good']); + }) ->when(isset($where['cate_pid']) && $where['cate_pid'], function ($query) use ($where) { $storeCategoryRepository = app()->make(StoreCategoryRepository::class); if (is_array($where['cate_pid'])) { diff --git a/app/controller/api/store/product/StoreSpu.php b/app/controller/api/store/product/StoreSpu.php index d115d0ae..13529971 100644 --- a/app/controller/api/store/product/StoreSpu.php +++ b/app/controller/api/store/product/StoreSpu.php @@ -57,7 +57,8 @@ class StoreSpu extends BaseController 'is_trader', 'product_ids', 'mer_id', - 'merchant_category_id' + 'merchant_category_id', + 'is_good' ]); $where['is_gift_bag'] = 0; $where['product_type'] = 0;