正在显示
1 个修改的文件
包含
7 行增加
和
0 行删除
| @@ -144,6 +144,8 @@ class KeywordLogic extends BaseLogic | @@ -144,6 +144,8 @@ class KeywordLogic extends BaseLogic | ||
| 144 | if($num > 1000){ | 144 | if($num > 1000){ |
| 145 | $this->fail('最大数量不能超过1000'); | 145 | $this->fail('最大数量不能超过1000'); |
| 146 | } | 146 | } |
| 147 | + DB::connection('custom_mysql')->beginTransaction(); | ||
| 148 | + try { | ||
| 147 | foreach ($this->param['title'] as $k=>$v){ | 149 | foreach ($this->param['title'] as $k=>$v){ |
| 148 | if(empty($v)){ | 150 | if(empty($v)){ |
| 149 | continue; | 151 | continue; |
| @@ -164,6 +166,11 @@ class KeywordLogic extends BaseLogic | @@ -164,6 +166,11 @@ class KeywordLogic extends BaseLogic | ||
| 164 | } | 166 | } |
| 165 | $this->model->edit(['route'=>$route],['id'=>$id]); | 167 | $this->model->edit(['route'=>$route],['id'=>$id]); |
| 166 | } | 168 | } |
| 169 | + DB::connection('custom_mysql')->commit(); | ||
| 170 | + }catch (\Exception $e){ | ||
| 171 | + $this->fail('系统错误请联系管理员'); | ||
| 172 | + DB::connection('custom_mysql')->rollBack(); | ||
| 173 | + } | ||
| 167 | return $this->success(); | 174 | return $this->success(); |
| 168 | } | 175 | } |
| 169 | 176 |
-
请 注册 或 登录 后发表评论