From 9e71b720e5b3ea68de8743cc457bedbe659c3e7f Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 26 Jan 2024 14:06:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/repositories/store/product/ProductRepository.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/common/repositories/store/product/ProductRepository.php b/app/common/repositories/store/product/ProductRepository.php index c79132b2..692f521d 100755 --- a/app/common/repositories/store/product/ProductRepository.php +++ b/app/common/repositories/store/product/ProductRepository.php @@ -1747,6 +1747,7 @@ class ProductRepository extends BaseRepository public function switchStatus($id, $data) { $product = $this->getSearch([])->find($id); + if(!$product) throw new ValidateException('商品不存在'); $this->dao->update($id, $data); $status = $data['status']; $type = self::NOTIC_MSG[$data['status']][$product['product_type']]; @@ -1760,7 +1761,7 @@ class ProductRepository extends BaseRepository ] ], $product['mer_id']); app()->make(SpuRepository::class)->changeStatus($id, $product->product_type); - event('product.sell', ['product_id' => [$id]]); + event('product.sell', ['product_id' => [$id,'status'=>$status]]); $this->switchShow($id, $status, 'is_used', 0); }