From 3a4bcecece1aadcfb3b2e97f569c95764b60c35f Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Fri, 9 Jun 2023 14:54:24 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=95=86=E5=93=81=E9=A2=84?= =?UTF-8?q?=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/repositories/store/product/ProductRepository.php | 4 +++- app/common/repositories/store/product/SpuRepository.php | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/common/repositories/store/product/ProductRepository.php b/app/common/repositories/store/product/ProductRepository.php index 466059ad..053249dd 100644 --- a/app/common/repositories/store/product/ProductRepository.php +++ b/app/common/repositories/store/product/ProductRepository.php @@ -1153,7 +1153,9 @@ class ProductRepository extends BaseRepository ]; $append = ['guaranteeTemplate','params']; - $where['product_type'] = $productType; + if (empty($where['product_id']) || $productType != 0) { + $where['product_type'] = $productType; + } $res = $this->dao->getWhere($where, $field, $with); if (!$res) return []; switch ($res['product_type']) { diff --git a/app/common/repositories/store/product/SpuRepository.php b/app/common/repositories/store/product/SpuRepository.php index 2cc66f70..5d8afec7 100644 --- a/app/common/repositories/store/product/SpuRepository.php +++ b/app/common/repositories/store/product/SpuRepository.php @@ -467,8 +467,10 @@ class SpuRepository extends BaseRepository $where = [ 'activity_id' => 0, 'product_id' => $id, - 'product_type' => $productType, ]; + if (empty($id) || $productType != 0) { + $where['product_type'] = $productType; + } break; case 1: $_make = app()->make(StoreSeckillActiveRepository::class);