正在显示
1 个修改的文件
包含
11 行增加
和
2 行删除
| @@ -124,9 +124,18 @@ class CustomTemplateLogic extends BaseLogic | @@ -124,9 +124,18 @@ class CustomTemplateLogic extends BaseLogic | ||
| 124 | * @time :2023/6/29 16:21 | 124 | * @time :2023/6/29 16:21 |
| 125 | */ | 125 | */ |
| 126 | public function customTemplateDel(){ | 126 | public function customTemplateDel(){ |
| 127 | + $info = $this->model->read(['id'=>$this->param['id']]); | ||
| 128 | + if($info === false){ | ||
| 129 | + $this->fail('当前数据不存在或者已被删除'); | ||
| 130 | + } | ||
| 127 | try { | 131 | try { |
| 128 | - $this->delRoute($this->param['id']); | ||
| 129 | - $this->model->del(['id'=>$this->param['id']]); | 132 | + if($info['status'] != 2){ |
| 133 | + $this->model->edit(['status'=>2],['id'=>$this->param['id']]); | ||
| 134 | + }else { | ||
| 135 | + $this->delRoute($this->param['id']); | ||
| 136 | + $this->model->del(['id' => $this->param['id']]); | ||
| 137 | + | ||
| 138 | + } | ||
| 130 | }catch (\Exception $e){ | 139 | }catch (\Exception $e){ |
| 131 | $this->fail('系统错误,请联系管理员'); | 140 | $this->fail('系统错误,请联系管理员'); |
| 132 | } | 141 | } |
-
请 注册 或 登录 后发表评论