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; }