6
0
Fork 0

修改删除商品提示

release
vine_liutk 2021-12-25 13:55:16 +08:00
parent e21c2f7125
commit f59736712d
1 changed files with 4 additions and 1 deletions

View File

@ -143,9 +143,12 @@ class ProductSkuController extends AdminController
public function destroy($id)
{
$sku = ProductSkuModel::findOrFail($id);
if ($sku->release_at || $sku->verify_state == 1 || $sku->sales > 0) {//如果是上架中、审核中或者已售出的,无法删除
if ($sku->release_at || $sku->verify_state == 1) {//如果是上架中、审核中或者已售出的,无法删除
throw new BizException(__('product-sku.options.deny_message'));
}
if ($sku->sales > 0){
throw new BizException('商品已售出,无法被删除');
}
return parent::destroy($id);
}