正在显示
1 个修改的文件
包含
7 行增加
和
7 行删除
| @@ -57,8 +57,8 @@ class BlogLogic extends BaseLogic | @@ -57,8 +57,8 @@ class BlogLogic extends BaseLogic | ||
| 57 | */ | 57 | */ |
| 58 | public function blogSave(){ | 58 | public function blogSave(){ |
| 59 | //拼接参数 | 59 | //拼接参数 |
| 60 | -// DB::beginTransaction(); | ||
| 61 | -// try { | 60 | + DB::beginTransaction(); |
| 61 | + try { | ||
| 62 | $this->param = $this->paramProcessing($this->param); | 62 | $this->param = $this->paramProcessing($this->param); |
| 63 | if(isset($this->param['id']) && !empty($this->param['id'])){ | 63 | if(isset($this->param['id']) && !empty($this->param['id'])){ |
| 64 | //是否更新路由 | 64 | //是否更新路由 |
| @@ -69,11 +69,11 @@ class BlogLogic extends BaseLogic | @@ -69,11 +69,11 @@ class BlogLogic extends BaseLogic | ||
| 69 | } | 69 | } |
| 70 | $route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_BLOG, $id, $this->user['project_id']); | 70 | $route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_BLOG, $id, $this->user['project_id']); |
| 71 | $this->edit(['url'=>$route],['id'=>$id]); | 71 | $this->edit(['url'=>$route],['id'=>$id]); |
| 72 | -// DB::commit(); | ||
| 73 | -// }catch (\Exception $e){ | ||
| 74 | -// DB::rollBack(); | ||
| 75 | -// $this->fail('error'); | ||
| 76 | -// } | 72 | + DB::commit(); |
| 73 | + }catch (\Exception $e){ | ||
| 74 | + DB::rollBack(); | ||
| 75 | + $this->fail('error'); | ||
| 76 | + } | ||
| 77 | //通知更新 | 77 | //通知更新 |
| 78 | $this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_BLOG, 'route'=>$route]); | 78 | $this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_BLOG, 'route'=>$route]); |
| 79 | return $this->success(); | 79 | return $this->success(); |
-
请 注册 或 登录 后发表评论