|
@@ -45,8 +45,8 @@ class NewsCategoryLogic extends BaseLogic |
|
@@ -45,8 +45,8 @@ class NewsCategoryLogic extends BaseLogic |
|
45
|
public function newsCategorySave(){
|
45
|
public function newsCategorySave(){
|
|
46
|
//验证名称是否存在
|
46
|
//验证名称是否存在
|
|
47
|
$this->verifyParamName($this->param['name']);
|
47
|
$this->verifyParamName($this->param['name']);
|
|
48
|
-// DB::beginTransaction();
|
|
|
|
49
|
-// try {
|
48
|
+ DB::beginTransaction();
|
|
|
|
49
|
+ try {
|
|
50
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
50
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
|
51
|
$id = $this->param['id'];
|
51
|
$id = $this->param['id'];
|
|
52
|
$this->param['alias'] = RouteMap::setRoute($this->param['alias'], RouteMap::SOURCE_NEWS_CATE, $id, $this->user['project_id']);
|
52
|
$this->param['alias'] = RouteMap::setRoute($this->param['alias'], RouteMap::SOURCE_NEWS_CATE, $id, $this->user['project_id']);
|
|
@@ -62,11 +62,11 @@ class NewsCategoryLogic extends BaseLogic |
|
@@ -62,11 +62,11 @@ class NewsCategoryLogic extends BaseLogic |
|
62
|
$route = RouteMap::setRoute($this->param['alias'], RouteMap::SOURCE_NEWS_CATE, $id, $this->user['project_id']);
|
62
|
$route = RouteMap::setRoute($this->param['alias'], RouteMap::SOURCE_NEWS_CATE, $id, $this->user['project_id']);
|
|
63
|
$this->model->edit(['alias'=>$route],['id'=>$id]);
|
63
|
$this->model->edit(['alias'=>$route],['id'=>$id]);
|
|
64
|
}
|
64
|
}
|
|
65
|
-// DB::commit();
|
|
|
|
66
|
-// }catch (\Exception $e){
|
|
|
|
67
|
-// DB::rollBack();
|
|
|
|
68
|
-// $this->fail('系统错误,请联系管理员');
|
|
|
|
69
|
-// }
|
65
|
+ DB::commit();
|
|
|
|
66
|
+ }catch (\Exception $e){
|
|
|
|
67
|
+ DB::rollBack();
|
|
|
|
68
|
+ $this->fail('系统错误,请联系管理员');
|
|
|
|
69
|
+ }
|
|
70
|
$this->addUpdateNotify(RouteMap::SOURCE_NEWS_CATE,$route);
|
70
|
$this->addUpdateNotify(RouteMap::SOURCE_NEWS_CATE,$route);
|
|
71
|
$this->curlDelRoute(['new_route'=>$route]);
|
71
|
$this->curlDelRoute(['new_route'=>$route]);
|
|
72
|
return $this->success(['id'=>$id]);
|
72
|
return $this->success(['id'=>$id]);
|