feat : banner

This commit is contained in:
2025-03-27 15:40:24 +08:00
parent 9a4e1dcf48
commit 1085ba14e8
4 changed files with 79 additions and 2 deletions

View File

@@ -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();