|
...
|
...
|
@@ -57,9 +57,9 @@ class NewsCategoryLogic extends BaseLogic |
|
|
|
*/
|
|
|
|
public function newsCategorySave(){
|
|
|
|
//验证名称是否存在
|
|
|
|
$this->verifyParamName($this->param['name']);
|
|
|
|
DB::beginTransaction();
|
|
|
|
try {
|
|
|
|
// $this->verifyParamName($this->param['name']);
|
|
|
|
// DB::beginTransaction();
|
|
|
|
// try {
|
|
|
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
|
|
|
//验证是否可编辑
|
|
|
|
$this->verifyEditParam($this->param['id'],$this->param['pid']);
|
|
...
|
...
|
@@ -74,11 +74,11 @@ class NewsCategoryLogic extends BaseLogic |
|
|
|
}
|
|
|
|
$route = RouteMap::setRoute($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'=>$this->param['alias']]);
|
|
|
|
return $this->success();
|
|
...
|
...
|
@@ -205,18 +205,6 @@ class NewsCategoryLogic extends BaseLogic |
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name :(参数处理)paramProcessing
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/6/13 11:30
|
|
|
|
*/
|
|
|
|
public function addParamProcessing($param){
|
|
|
|
$param['project_id'] = $this->user['project_id'];
|
|
|
|
$param['operator_id'] = $this->user['id'];
|
|
|
|
$param['create_id'] = $this->user['id'];
|
|
|
|
return $this->success($param);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name :(添加分类时处理子集分类)addProcessingSon
|
...
|
...
|
|