正在显示
2 个修改的文件
包含
14 行增加
和
14 行删除
| @@ -33,8 +33,8 @@ class BlogLogic extends BaseLogic | @@ -33,8 +33,8 @@ class BlogLogic extends BaseLogic | ||
| 33 | */ | 33 | */ |
| 34 | public function blogSave(){ | 34 | public function blogSave(){ |
| 35 | //拼接参数 | 35 | //拼接参数 |
| 36 | -// DB::beginTransaction(); | ||
| 37 | -// try { | 36 | + DB::beginTransaction(); |
| 37 | + try { | ||
| 38 | $this->param = $this->paramProcessing($this->param); | 38 | $this->param = $this->paramProcessing($this->param); |
| 39 | if(isset($this->param['id']) && !empty($this->param['id'])){ | 39 | if(isset($this->param['id']) && !empty($this->param['id'])){ |
| 40 | //是否更新路由 | 40 | //是否更新路由 |
| @@ -45,11 +45,11 @@ class BlogLogic extends BaseLogic | @@ -45,11 +45,11 @@ class BlogLogic extends BaseLogic | ||
| 45 | } | 45 | } |
| 46 | $route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_BLOG, $id, $this->user['project_id']); | 46 | $route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_BLOG, $id, $this->user['project_id']); |
| 47 | $this->edit(['url'=>$route],['id'=>$id]); | 47 | $this->edit(['url'=>$route],['id'=>$id]); |
| 48 | -// DB::commit(); | ||
| 49 | -// }catch (\Exception $e){ | ||
| 50 | -// DB::rollBack(); | ||
| 51 | -// $this->fail('error'); | ||
| 52 | -// } | 48 | + DB::commit(); |
| 49 | + }catch (\Exception $e){ | ||
| 50 | + DB::rollBack(); | ||
| 51 | + $this->fail('error'); | ||
| 52 | + } | ||
| 53 | //通知更新 | 53 | //通知更新 |
| 54 | $this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_BLOG, 'route'=>$route]); | 54 | $this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_BLOG, 'route'=>$route]); |
| 55 | return $this->success(); | 55 | return $this->success(); |
| @@ -61,8 +61,8 @@ class NewsLogic extends BaseLogic | @@ -61,8 +61,8 @@ class NewsLogic extends BaseLogic | ||
| 61 | public function newsSave() | 61 | public function newsSave() |
| 62 | { | 62 | { |
| 63 | //拼接参数 | 63 | //拼接参数 |
| 64 | - DB::beginTransaction(); | ||
| 65 | - try { | 64 | +// DB::beginTransaction(); |
| 65 | +// try { | ||
| 66 | $this->param = $this->paramProcessing($this->param); | 66 | $this->param = $this->paramProcessing($this->param); |
| 67 | if (isset($this->param['id']) && !empty($this->param['id'])) { | 67 | if (isset($this->param['id']) && !empty($this->param['id'])) { |
| 68 | //是否更新路由 | 68 | //是否更新路由 |
| @@ -74,11 +74,11 @@ class NewsLogic extends BaseLogic | @@ -74,11 +74,11 @@ class NewsLogic extends BaseLogic | ||
| 74 | //更新路由 | 74 | //更新路由 |
| 75 | $route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_NEWS, $id, $this->user['project_id']); | 75 | $route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_NEWS, $id, $this->user['project_id']); |
| 76 | $this->edit(['url' => $route], ['id' => $id]); | 76 | $this->edit(['url' => $route], ['id' => $id]); |
| 77 | - DB::commit(); | ||
| 78 | - } catch (\Exception $e) { | ||
| 79 | - DB::rollBack(); | ||
| 80 | - $this->fail('系统错误,请联系管理员'); | ||
| 81 | - } | 77 | +// DB::commit(); |
| 78 | +// } catch (\Exception $e) { | ||
| 79 | +// DB::rollBack(); | ||
| 80 | +// $this->fail('系统错误,请联系管理员'); | ||
| 81 | +// } | ||
| 82 | //通知更新 | 82 | //通知更新 |
| 83 | $this->updateNotify(['project_id' => $this->user['project_id'], 'type' => RouteMap::SOURCE_NEWS, 'route' => $route]); | 83 | $this->updateNotify(['project_id' => $this->user['project_id'], 'type' => RouteMap::SOURCE_NEWS, 'route' => $route]); |
| 84 | return $this->success(); | 84 | return $this->success(); |
-
请 注册 或 登录 后发表评论