作者 lyh

gx

@@ -58,8 +58,8 @@ class NewsCategoryLogic extends BaseLogic @@ -58,8 +58,8 @@ class NewsCategoryLogic extends BaseLogic
58 public function newsCategorySave(){ 58 public function newsCategorySave(){
59 //验证名称是否存在 59 //验证名称是否存在
60 $this->verifyParamName($this->param['name']); 60 $this->verifyParamName($this->param['name']);
61 - DB::beginTransaction();  
62 - try { 61 +// DB::beginTransaction();
  62 +// try {
63 if(isset($this->param['id']) && !empty($this->param['id'])){ 63 if(isset($this->param['id']) && !empty($this->param['id'])){
64 //验证是否可编辑 64 //验证是否可编辑
65 $this->verifyEditParam($this->param['id'],$this->param['pid']); 65 $this->verifyEditParam($this->param['id'],$this->param['pid']);
@@ -75,11 +75,11 @@ class NewsCategoryLogic extends BaseLogic @@ -75,11 +75,11 @@ class NewsCategoryLogic extends BaseLogic
75 } 75 }
76 $route = RouteMap::setRoute($this->param['alias'] ?: $this->param['name'], RouteMap::SOURCE_NEWS_CATE, $id, $this->user['project_id']); 76 $route = RouteMap::setRoute($this->param['alias'] ?: $this->param['name'], RouteMap::SOURCE_NEWS_CATE, $id, $this->user['project_id']);
77 $this->model->edit(['alias'=>$route],['id'=>$id]); 77 $this->model->edit(['alias'=>$route],['id'=>$id]);
78 - DB::commit();  
79 - }catch (\Exception $e){  
80 - DB::rollBack();  
81 - $this->fail('error');  
82 - } 78 +// DB::commit();
  79 +// }catch (\Exception $e){
  80 +// DB::rollBack();
  81 +// $this->fail('error');
  82 +// }
83 //更新通知记录表 83 //更新通知记录表
84 $this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_NEWS_CATE, 'route'=>$route]); 84 $this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_NEWS_CATE, 'route'=>$route]);
85 return $this->success(); 85 return $this->success();