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