正在显示
1 个修改的文件
包含
7 行增加
和
2 行删除
| @@ -167,8 +167,13 @@ class NewsLogic extends BaseLogic | @@ -167,8 +167,13 @@ class NewsLogic extends BaseLogic | ||
| 167 | DB::beginTransaction(); | 167 | DB::beginTransaction(); |
| 168 | try { | 168 | try { |
| 169 | foreach ($this->param['id'] as $id) { | 169 | foreach ($this->param['id'] as $id) { |
| 170 | - $this->delRoute($id); | ||
| 171 | - $this->model->del(['id' => $id]); | 170 | + $info = $this->model->read(['id'=>$id],['id','status']); |
| 171 | + if($info['status'] != 2){ | ||
| 172 | + $this->model->edit(['status'=>2],['id'=>$id]); | ||
| 173 | + }else{ | ||
| 174 | + $this->delRoute($id); | ||
| 175 | + $this->model->del(['id' => $id]); | ||
| 176 | + } | ||
| 172 | } | 177 | } |
| 173 | DB::commit(); | 178 | DB::commit(); |
| 174 | } catch (Exception $e) { | 179 | } catch (Exception $e) { |
-
请 注册 或 登录 后发表评论