正在显示
1 个修改的文件
包含
7 行增加
和
7 行删除
| @@ -48,8 +48,8 @@ class KeywordLogic extends BaseLogic | @@ -48,8 +48,8 @@ class KeywordLogic extends BaseLogic | ||
| 48 | * @time :2023/8/23 16:50 | 48 | * @time :2023/8/23 16:50 |
| 49 | */ | 49 | */ |
| 50 | public function keywordSave(){ | 50 | public function keywordSave(){ |
| 51 | -// DB::beginTransaction(); | ||
| 52 | -// try { | 51 | + DB::beginTransaction(); |
| 52 | + try { | ||
| 53 | if(isset($this->param['id']) && !empty($this->param['id'])){ | 53 | if(isset($this->param['id']) && !empty($this->param['id'])){ |
| 54 | $route = RouteMap::setRoute($this->param['title'], RouteMap::SOURCE_PRODUCT_KEYWORD, $this->param['id'], $this->user['project_id']); | 54 | $route = RouteMap::setRoute($this->param['title'], RouteMap::SOURCE_PRODUCT_KEYWORD, $this->param['id'], $this->user['project_id']); |
| 55 | $id = $this->editCategoryRoute($this->param['id'],$route); | 55 | $id = $this->editCategoryRoute($this->param['id'],$route); |
| @@ -63,11 +63,11 @@ class KeywordLogic extends BaseLogic | @@ -63,11 +63,11 @@ class KeywordLogic extends BaseLogic | ||
| 63 | $route = RouteMap::setRoute($this->param['title'], RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $this->user['project_id']); | 63 | $route = RouteMap::setRoute($this->param['title'], RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $this->user['project_id']); |
| 64 | } | 64 | } |
| 65 | $this->model->edit(['route'=>$route],['id'=>$id]); | 65 | $this->model->edit(['route'=>$route],['id'=>$id]); |
| 66 | -// DB::commit(); | ||
| 67 | -// }catch (\Exception $e){ | ||
| 68 | -// DB::rollBack(); | ||
| 69 | -// $this->fail('保存失败'); | ||
| 70 | -// } | 66 | + DB::commit(); |
| 67 | + }catch (\Exception $e){ | ||
| 68 | + DB::rollBack(); | ||
| 69 | + $this->fail('保存失败'); | ||
| 70 | + } | ||
| 71 | //通知更新 | 71 | //通知更新 |
| 72 | $this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_PRODUCT_KEYWORD, 'route'=>$route]); | 72 | $this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_PRODUCT_KEYWORD, 'route'=>$route]); |
| 73 | return $this->success(); | 73 | return $this->success(); |
-
请 注册 或 登录 后发表评论