|
@@ -61,11 +61,13 @@ class NewsCategoryLogic extends BaseLogic |
|
@@ -61,11 +61,13 @@ class NewsCategoryLogic extends BaseLogic |
|
61
|
public function newsCategorySave(){
|
61
|
public function newsCategorySave(){
|
|
62
|
//验证名称是否存在
|
62
|
//验证名称是否存在
|
|
63
|
$this->verifyParamName($this->param['name']);
|
63
|
$this->verifyParamName($this->param['name']);
|
|
|
|
64
|
+ //验证是否可编辑
|
|
|
|
65
|
+ if(isset($this->param['id']) && !empty($this->param['id'])) {
|
|
|
|
66
|
+ $this->verifyEditParam($this->param['id'], $this->param['pid']);
|
|
|
|
67
|
+ }
|
|
64
|
DB::beginTransaction();
|
68
|
DB::beginTransaction();
|
|
65
|
try {
|
69
|
try {
|
|
66
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
70
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
|
67
|
- //验证是否可编辑
|
|
|
|
68
|
- $this->verifyEditParam($this->param['id'],$this->param['pid']);
|
|
|
|
69
|
$this->param['operator_id'] = $this->user['id'];
|
71
|
$this->param['operator_id'] = $this->user['id'];
|
|
70
|
//查看路由是否更新
|
72
|
//查看路由是否更新
|
|
71
|
$id = $this->editCategoryRoute($this->param['id'],$this->param['alias'] ?? RouteMap::setRoute(isset($this->param['alias']) ? $this->param['alias'] : $this->param['name'],
|
73
|
$id = $this->editCategoryRoute($this->param['id'],$this->param['alias'] ?? RouteMap::setRoute(isset($this->param['alias']) ? $this->param['alias'] : $this->param['name'],
|
|
@@ -82,7 +84,7 @@ class NewsCategoryLogic extends BaseLogic |
|
@@ -82,7 +84,7 @@ class NewsCategoryLogic extends BaseLogic |
|
82
|
DB::commit();
|
84
|
DB::commit();
|
|
83
|
}catch (\Exception $e){
|
85
|
}catch (\Exception $e){
|
|
84
|
DB::rollBack();
|
86
|
DB::rollBack();
|
|
85
|
- $this->fail('error');
|
87
|
+ $this->fail('系统错误,请联系管理员');
|
|
86
|
}
|
88
|
}
|
|
87
|
//更新通知记录表
|
89
|
//更新通知记录表
|
|
88
|
$this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_NEWS_CATE, 'route'=>$route]);
|
90
|
$this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_NEWS_CATE, 'route'=>$route]);
|