|
...
|
...
|
@@ -45,7 +45,7 @@ class NewsCategoryLogic extends BaseLogic |
|
|
|
try {
|
|
|
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
|
|
|
$this->param['alias'] = RouteMap::setRoute($this->param['alias'], RouteMap::SOURCE_NEWS_CATE, $this->param['id'], $this->user['project_id']);
|
|
|
|
$this->editCategoryRoute($this->param['id'],$this->param['alias']);
|
|
|
|
$route = $this->param['alias'];
|
|
|
|
$this->editHandleCategory($this->param['id'],$this->param['pid']);
|
|
|
|
$this->param['operator_id'] = $this->user['id'];
|
|
|
|
$this->edit($this->param,['id'=>$this->param['id']]);
|
|
...
|
...
|
@@ -56,8 +56,6 @@ class NewsCategoryLogic extends BaseLogic |
|
|
|
$this->param = $this->addParamProcessing($this->param);
|
|
|
|
$id = $this->model->addReturnId($this->param);
|
|
|
|
$route = RouteMap::setRoute($this->param['alias'], RouteMap::SOURCE_NEWS_CATE, $id, $this->user['project_id']);
|
|
|
|
$this->addUpdateNotify(RouteMap::SOURCE_NEWS_CATE,$route);
|
|
|
|
$this->curlDelRoute(['new_route'=>$route]);
|
|
|
|
$this->model->edit(['alias'=>$route],['id'=>$id]);
|
|
|
|
//当父级分类拥有产品时,处理子集
|
|
|
|
$this->addProcessingSon($id);
|
|
...
|
...
|
@@ -67,6 +65,8 @@ class NewsCategoryLogic extends BaseLogic |
|
|
|
DB::rollBack();
|
|
|
|
$this->fail('系统错误,请联系管理员');
|
|
|
|
}
|
|
|
|
$this->addUpdateNotify(RouteMap::SOURCE_NEWS_CATE,$route);
|
|
|
|
$this->curlDelRoute(['new_route'=>$route]);
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -112,23 +112,6 @@ class NewsCategoryLogic extends BaseLogic |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :编辑路由时生成路由记录
|
|
|
|
* @name :editCategoryRoute
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/9/7 10:51
|
|
|
|
*/
|
|
|
|
public function editCategoryRoute($id,$route){
|
|
|
|
//生成一条删除路由记录
|
|
|
|
$info = $this->model->read(['id'=>$id],['id','alias']);
|
|
|
|
if($info['alias'] != $route){
|
|
|
|
$this->addUpdateNotify(RouteMap::SOURCE_NEWS_CATE,$route);
|
|
|
|
$this->curlDelRoute(['route'=>$info['alias'],'new_route'=>$route]);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :修改状态
|
...
|
...
|
|