|
...
|
...
|
@@ -63,6 +63,7 @@ class NewsCategoryLogic extends BaseLogic |
|
|
|
$this->verifyParamName($this->param['name']);
|
|
|
|
$this->param = $this->handleParam($this->param);
|
|
|
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
|
|
|
$info = $this->model->read(['id'=>$this->param['id']],['id','alias']);
|
|
|
|
$id = $this->param['id'];
|
|
|
|
$this->param['alias'] = RouteMap::setRoute($this->param['alias'], RouteMap::SOURCE_NEWS_CATE, $id, $this->user['project_id']);
|
|
|
|
$route = $this->param['alias'];
|
|
...
|
...
|
@@ -71,6 +72,7 @@ class NewsCategoryLogic extends BaseLogic |
|
|
|
}
|
|
|
|
$this->param['operator_id'] = $this->user['id'];
|
|
|
|
$this->edit($this->param,['id'=>$id]);
|
|
|
|
$this->curlDelRoute(['new_route'=>$route ?? '','old_route'=>$info['alias'] ?? '']);
|
|
|
|
}else{
|
|
|
|
if(!isset($this->param['alias']) || empty($this->param['alias'])){
|
|
|
|
$this->param['alias'] = Translate::tran($this->param['name'], 'en');
|
|
...
|
...
|
@@ -82,9 +84,9 @@ class NewsCategoryLogic extends BaseLogic |
|
|
|
$id = $this->model->addReturnId($this->param);
|
|
|
|
$route = RouteMap::setRoute($this->param['alias'], RouteMap::SOURCE_NEWS_CATE, $id, $this->user['project_id']);
|
|
|
|
$this->model->edit(['alias'=>$route],['id'=>$id]);
|
|
|
|
$this->curlDelRoute(['new_route'=>$route]);
|
|
|
|
}
|
|
|
|
$this->addUpdateNotify(RouteMap::SOURCE_NEWS_CATE,$route);
|
|
|
|
$this->curlDelRoute(['new_route'=>$route]);
|
|
|
|
return $this->success(['id'=>$id]);
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|