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