处理不删除服务器上图片
parent
8c524d277f
commit
bde3409681
|
|
@ -77,11 +77,13 @@ class ProductSkuController extends AdminController
|
||||||
->move('product-skus/cover/'.Carbon::now()->toDateString())
|
->move('product-skus/cover/'.Carbon::now()->toDateString())
|
||||||
->saveFullUrl()
|
->saveFullUrl()
|
||||||
->removable(false)
|
->removable(false)
|
||||||
|
->retainable()
|
||||||
->autoUpload();
|
->autoUpload();
|
||||||
$form->multipleImage('images')
|
$form->multipleImage('images')
|
||||||
->move('product-skus/'.Carbon::now()->toDateString())
|
->move('product-skus/'.Carbon::now()->toDateString())
|
||||||
->saveFullUrl()
|
->saveFullUrl()
|
||||||
->removable(false)
|
->removable(false)
|
||||||
|
->retainable()
|
||||||
->autoUpload();
|
->autoUpload();
|
||||||
$form->file('media')->chunked()
|
$form->file('media')->chunked()
|
||||||
->accept('mp4', 'mp4/*')
|
->accept('mp4', 'mp4/*')
|
||||||
|
|
@ -89,6 +91,7 @@ class ProductSkuController extends AdminController
|
||||||
->maxSize(204800)//默认最大200M
|
->maxSize(204800)//默认最大200M
|
||||||
->saveFullUrl()
|
->saveFullUrl()
|
||||||
->removable(false)
|
->removable(false)
|
||||||
|
->retainable()
|
||||||
->autoSave(false)
|
->autoSave(false)
|
||||||
->autoUpload();
|
->autoUpload();
|
||||||
$form->editor('description');
|
$form->editor('description');
|
||||||
|
|
@ -146,7 +149,7 @@ class ProductSkuController extends AdminController
|
||||||
if ($sku->release_at || $sku->verify_state == 1) {//如果是上架中、审核中或者已售出的,无法删除
|
if ($sku->release_at || $sku->verify_state == 1) {//如果是上架中、审核中或者已售出的,无法删除
|
||||||
throw new BizException(__('product-sku.options.deny_message'));
|
throw new BizException(__('product-sku.options.deny_message'));
|
||||||
}
|
}
|
||||||
if ($sku->sales > 0){
|
if ($sku->sales > 0) {
|
||||||
throw new BizException('商品已售出,无法被删除');
|
throw new BizException('商品已售出,无法被删除');
|
||||||
}
|
}
|
||||||
return parent::destroy($id);
|
return parent::destroy($id);
|
||||||
|
|
|
||||||
|
|
@ -133,11 +133,13 @@ class ProductSpuController extends AdminController
|
||||||
->move('product-spus/cover/'.Carbon::now()->toDateString())
|
->move('product-spus/cover/'.Carbon::now()->toDateString())
|
||||||
->saveFullUrl()
|
->saveFullUrl()
|
||||||
->removable(false)
|
->removable(false)
|
||||||
|
->retainable()
|
||||||
->autoUpload();
|
->autoUpload();
|
||||||
$form->multipleImage('images')
|
$form->multipleImage('images')
|
||||||
->move('product-spus/'.Carbon::now()->toDateString())
|
->move('product-spus/'.Carbon::now()->toDateString())
|
||||||
->saveFullUrl()
|
->saveFullUrl()
|
||||||
->removable(false)
|
->removable(false)
|
||||||
|
->retainable()
|
||||||
->autoUpload();
|
->autoUpload();
|
||||||
$form->file('media')->chunked()
|
$form->file('media')->chunked()
|
||||||
->accept('mp4', 'mp4/*')
|
->accept('mp4', 'mp4/*')
|
||||||
|
|
@ -145,6 +147,7 @@ class ProductSpuController extends AdminController
|
||||||
->maxSize(204800)//默认最大200M
|
->maxSize(204800)//默认最大200M
|
||||||
->saveFullUrl()
|
->saveFullUrl()
|
||||||
->removable(false)
|
->removable(false)
|
||||||
|
->retainable()
|
||||||
->autoSave(false)
|
->autoSave(false)
|
||||||
->autoUpload();
|
->autoUpload();
|
||||||
$form->multipleSelect('features')->options(ProductFeature::all()->pluck('name', 'id'))->customFormat(function ($v) {
|
$form->multipleSelect('features')->options(ProductFeature::all()->pluck('name', 'id'))->customFormat(function ($v) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue