作者 lyh

gx

... ... @@ -64,14 +64,14 @@ class NewsCategoryLogic extends BaseLogic
$cate_id = $this->model->insertGetId($this->param);
//当父级分类拥有产品时,处理产品
$this->addProcessingSon($cate_id);
$route = RouteMap::setRoute($this->param['alias'] ?: $this->param['name'], RouteMap::SOURCE_NEWS_CATE, $cate_id, $this->user['project_id']);
RouteMap::setRoute($this->param['alias'] ?: $this->param['name'], RouteMap::SOURCE_NEWS_CATE, $cate_id, $this->user['project_id']);
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]);
$this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_NEWS_CATE, 'route'=>$this->param['alias']]);
return $this->success();
}
... ... @@ -87,10 +87,10 @@ class NewsCategoryLogic extends BaseLogic
//验证是否可编辑
$this->verifyEditParam();
$this->param['operator_id'] = $this->user['id'];
$this->param['alias'] = RouteMap::setRoute($this->param['alias'] ?: $this->param['name'], RouteMap::SOURCE_NEWS_CATE, $this->param['id'], $this->user['project_id']);
$this->edit($this->param,['id'=>$this->param['id']]);
$route = RouteMap::setRoute($this->param['alias'] ?: $this->param['name'], RouteMap::SOURCE_NEWS_CATE, $this->param['id'], $this->user['project_id']);
//通知更新
$this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_NEWS_CATE, 'route'=>$route]);
$this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_NEWS_CATE, 'route'=>$this->param['alias']]);
return $this->success();
}
... ... @@ -213,6 +213,7 @@ class NewsCategoryLogic extends BaseLogic
$param['create_id'] = $this->user['id'];
$param['created_at'] = date('Y-m-d H:i:s');
$param['updated_at'] = date('Y-m-d H:i:s');
$param['alias'] = RouteMap::generateRoute($param['alias'], RouteMap::SOURCE_NEWS_CATE, $param['id'], $this->user['project_id']);
return $this->success($param);
}
... ...