This commit is contained in:
shengchanzhe 2023-12-23 17:18:08 +08:00
parent 9e80e6babf
commit eedcccff1c

View File

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