From eedcccff1c1d29f349b723331f7a76d0bc239add Mon Sep 17 00:00:00 2001 From: shengchanzhe <179998674@qq.com> Date: Sat, 23 Dec 2023 17:18:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/repositories/store/product/ProductRepository.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/common/repositories/store/product/ProductRepository.php b/app/common/repositories/store/product/ProductRepository.php index d584372e..3d5917d5 100644 --- a/app/common/repositories/store/product/ProductRepository.php +++ b/app/common/repositories/store/product/ProductRepository.php @@ -2606,7 +2606,11 @@ class ProductRepository extends BaseRepository 'create_time' => date('Y-m-d H:i:s'), 'mer_labels' => ',' . $data['type'] . ',', ]; - return Db::name('cloud_product')->insert($datas); + $res= Db::name('cloud_product')->where('product_id',$data['product_id'])->where('mer_id',$merchant['mer_id'])->find(); + if($res){ + throw new ValidateException('该商品已设置过'); + } + return Db::name('cloud_product')->insert($datas); } return false; }