From 9abac148024ceedc353e55243fb283e767616fce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E6=A1=83?= <1098598843@qq.com> Date: Mon, 27 Feb 2023 14:53:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/dao/store/product/SpuDao.php | 3 +++ app/controller/api/store/product/StoreSpu.php | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) 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;