6
0
Fork 0

处理不删除服务器上图片

release
vine_liutk 2021-12-28 17:30:19 +08:00
parent 8c524d277f
commit bde3409681
2 changed files with 7 additions and 1 deletions

View File

@ -77,11 +77,13 @@ class ProductSkuController extends AdminController
->move('product-skus/cover/'.Carbon::now()->toDateString())
->saveFullUrl()
->removable(false)
->retainable()
->autoUpload();
$form->multipleImage('images')
->move('product-skus/'.Carbon::now()->toDateString())
->saveFullUrl()
->removable(false)
->retainable()
->autoUpload();
$form->file('media')->chunked()
->accept('mp4', 'mp4/*')
@ -89,6 +91,7 @@ class ProductSkuController extends AdminController
->maxSize(204800)//默认最大200M
->saveFullUrl()
->removable(false)
->retainable()
->autoSave(false)
->autoUpload();
$form->editor('description');
@ -146,7 +149,7 @@ class ProductSkuController extends AdminController
if ($sku->release_at || $sku->verify_state == 1) {//如果是上架中、审核中或者已售出的,无法删除
throw new BizException(__('product-sku.options.deny_message'));
}
if ($sku->sales > 0){
if ($sku->sales > 0) {
throw new BizException('商品已售出,无法被删除');
}
return parent::destroy($id);

View File

@ -133,11 +133,13 @@ class ProductSpuController extends AdminController
->move('product-spus/cover/'.Carbon::now()->toDateString())
->saveFullUrl()
->removable(false)
->retainable()
->autoUpload();
$form->multipleImage('images')
->move('product-spus/'.Carbon::now()->toDateString())
->saveFullUrl()
->removable(false)
->retainable()
->autoUpload();
$form->file('media')->chunked()
->accept('mp4', 'mp4/*')
@ -145,6 +147,7 @@ class ProductSpuController extends AdminController
->maxSize(204800)//默认最大200M
->saveFullUrl()
->removable(false)
->retainable()
->autoSave(false)
->autoUpload();
$form->multipleSelect('features')->options(ProductFeature::all()->pluck('name', 'id'))->customFormat(function ($v) {