正在显示
1 个修改的文件
包含
5 行增加
和
4 行删除
| @@ -64,14 +64,14 @@ class NewsCategoryLogic extends BaseLogic | @@ -64,14 +64,14 @@ class NewsCategoryLogic extends BaseLogic | ||
| 64 | $cate_id = $this->model->insertGetId($this->param); | 64 | $cate_id = $this->model->insertGetId($this->param); |
| 65 | //当父级分类拥有产品时,处理产品 | 65 | //当父级分类拥有产品时,处理产品 |
| 66 | $this->addProcessingSon($cate_id); | 66 | $this->addProcessingSon($cate_id); |
| 67 | - $route = RouteMap::setRoute($this->param['alias'] ?: $this->param['name'], RouteMap::SOURCE_NEWS_CATE, $cate_id, $this->user['project_id']); | 67 | + RouteMap::setRoute($this->param['alias'] ?: $this->param['name'], RouteMap::SOURCE_NEWS_CATE, $cate_id, $this->user['project_id']); |
| 68 | DB::commit(); | 68 | DB::commit(); |
| 69 | }catch (\Exception $e){ | 69 | }catch (\Exception $e){ |
| 70 | DB::rollBack(); | 70 | DB::rollBack(); |
| 71 | $this->fail('error'); | 71 | $this->fail('error'); |
| 72 | } | 72 | } |
| 73 | //通知更新 | 73 | //通知更新 |
| 74 | - $this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_NEWS_CATE, 'route'=>$route]); | 74 | + $this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_NEWS_CATE, 'route'=>$this->param['alias']]); |
| 75 | return $this->success(); | 75 | return $this->success(); |
| 76 | } | 76 | } |
| 77 | 77 | ||
| @@ -87,10 +87,10 @@ class NewsCategoryLogic extends BaseLogic | @@ -87,10 +87,10 @@ class NewsCategoryLogic extends BaseLogic | ||
| 87 | //验证是否可编辑 | 87 | //验证是否可编辑 |
| 88 | $this->verifyEditParam(); | 88 | $this->verifyEditParam(); |
| 89 | $this->param['operator_id'] = $this->user['id']; | 89 | $this->param['operator_id'] = $this->user['id']; |
| 90 | + $this->param['alias'] = RouteMap::setRoute($this->param['alias'] ?: $this->param['name'], RouteMap::SOURCE_NEWS_CATE, $this->param['id'], $this->user['project_id']); | ||
| 90 | $this->edit($this->param,['id'=>$this->param['id']]); | 91 | $this->edit($this->param,['id'=>$this->param['id']]); |
| 91 | - $route = RouteMap::setRoute($this->param['alias'] ?: $this->param['name'], RouteMap::SOURCE_NEWS_CATE, $this->param['id'], $this->user['project_id']); | ||
| 92 | //通知更新 | 92 | //通知更新 |
| 93 | - $this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_NEWS_CATE, 'route'=>$route]); | 93 | + $this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_NEWS_CATE, 'route'=>$this->param['alias']]); |
| 94 | return $this->success(); | 94 | return $this->success(); |
| 95 | } | 95 | } |
| 96 | 96 | ||
| @@ -213,6 +213,7 @@ class NewsCategoryLogic extends BaseLogic | @@ -213,6 +213,7 @@ class NewsCategoryLogic extends BaseLogic | ||
| 213 | $param['create_id'] = $this->user['id']; | 213 | $param['create_id'] = $this->user['id']; |
| 214 | $param['created_at'] = date('Y-m-d H:i:s'); | 214 | $param['created_at'] = date('Y-m-d H:i:s'); |
| 215 | $param['updated_at'] = date('Y-m-d H:i:s'); | 215 | $param['updated_at'] = date('Y-m-d H:i:s'); |
| 216 | + $param['alias'] = RouteMap::generateRoute($param['alias'], RouteMap::SOURCE_NEWS_CATE, $param['id'], $this->user['project_id']); | ||
| 216 | return $this->success($param); | 217 | return $this->success($param); |
| 217 | } | 218 | } |
| 218 | 219 |
-
请 注册 或 登录 后发表评论