feat : banner
This commit is contained in:
@@ -60,6 +60,8 @@ class BannerService extends BaseService
|
||||
$insertModel->type = $this->request->input('type');
|
||||
$insertModel->value = $this->request->input('value');
|
||||
|
||||
$this->updateOssObjects([$insertModel->image_id]);
|
||||
|
||||
if (!$insertModel->save()) throw new ErrException('添加错误');
|
||||
|
||||
return $this->return->success();
|
||||
@@ -89,6 +91,11 @@ class BannerService extends BaseService
|
||||
$info->type = $this->request->input('type');
|
||||
$info->value = $this->request->input('value');
|
||||
|
||||
if ($info->image_id != $this->request->input('image_id')) {
|
||||
$this->updateOssObjectsDisable([$info->image_id]);
|
||||
$this->updateOssObjects([$this->request->input('image_id')]);
|
||||
}
|
||||
|
||||
if (!$info->save()) throw new ErrException('修改错误');
|
||||
|
||||
return $this->return->success();
|
||||
|
||||
Reference in New Issue
Block a user