|
...
|
...
|
@@ -114,7 +114,7 @@ class CategoryLogic extends BaseLogic |
|
|
|
try {
|
|
|
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
|
|
|
$this->param['route'] = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_PRODUCT_CATE, $this->param['id'], $this->user['project_id']);
|
|
|
|
$this->editCategoryRoute($this->param['id'],$this->param['route']);
|
|
|
|
$route = $this->param['route'];
|
|
|
|
//处理子集
|
|
|
|
$this->editHandleCategory($this->param['id'],$this->param['pid']);
|
|
|
|
$this->model->edit($this->param,['id'=>$this->param['id']]);
|
|
...
|
...
|
@@ -122,12 +122,12 @@ class CategoryLogic extends BaseLogic |
|
|
|
$this->param['project_id'] = $this->user['project_id'];
|
|
|
|
$id = $this->model->addReturnId($this->param);
|
|
|
|
$route = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_PRODUCT_CATE, $id, $this->user['project_id']);
|
|
|
|
$this->addUpdateNotify(RouteMap::SOURCE_PRODUCT_CATE,$route);
|
|
|
|
$this->curlDelRoute(['new_route'=>$route]);
|
|
|
|
$this->edit(['route'=>$route],['id'=>$id]);
|
|
|
|
//处理子集
|
|
|
|
$this->addProcessingSon($id);
|
|
|
|
}
|
|
|
|
$this->addUpdateNotify(RouteMap::SOURCE_PRODUCT_CATE,$route);
|
|
|
|
$this->curlDelRoute(['new_route'=>$route]);
|
|
|
|
//清除缓存
|
|
|
|
Common::del_user_cache('product_category',$this->user['project_id']);
|
|
|
|
DB::commit();
|
|
...
|
...
|
@@ -223,23 +223,6 @@ class CategoryLogic 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','route']);
|
|
|
|
if($info['route'] != $route){
|
|
|
|
$this->addUpdateNotify(RouteMap::SOURCE_PRODUCT_CATE,$route);
|
|
|
|
$this->curlDelRoute(['route'=>$info['route'],'new_route'=>$route]);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :删除
|
|
|
|
* @name :delete
|
|
|
|
* @author :lyh
|
...
|
...
|
|