正在显示
4 个修改的文件
包含
12 行增加
和
4 行删除
| @@ -34,11 +34,13 @@ class BlogCategoryLogic extends BaseLogic | @@ -34,11 +34,13 @@ class BlogCategoryLogic extends BaseLogic | ||
| 34 | DB::beginTransaction(); | 34 | DB::beginTransaction(); |
| 35 | try { | 35 | try { |
| 36 | if(isset($this->param['id']) && !empty($this->param['id'])){ | 36 | if(isset($this->param['id']) && !empty($this->param['id'])){ |
| 37 | + $info = $this->model->read(['id'=>$this->param['id']],['id','alias']); | ||
| 37 | $id = $this->param['id']; | 38 | $id = $this->param['id']; |
| 38 | $this->param['alias'] = RouteMap::setRoute($this->param['alias'], RouteMap::SOURCE_BLOG_CATE, $id, $this->user['project_id']); | 39 | $this->param['alias'] = RouteMap::setRoute($this->param['alias'], RouteMap::SOURCE_BLOG_CATE, $id, $this->user['project_id']); |
| 39 | $route = $this->param['alias']; | 40 | $route = $this->param['alias']; |
| 40 | $this->param['operator_id'] = $this->user['id']; | 41 | $this->param['operator_id'] = $this->user['id']; |
| 41 | $this->edit($this->param,['id'=>$id]); | 42 | $this->edit($this->param,['id'=>$id]); |
| 43 | + $this->curlDelRoute(['new_route'=>$route ?? '','old_route'=>$info['alias'] ?? '']); | ||
| 42 | }else{ | 44 | }else{ |
| 43 | //路由拼接 | 45 | //路由拼接 |
| 44 | if(!isset($this->param['alias']) || empty($this->param['alias'])){ | 46 | if(!isset($this->param['alias']) || empty($this->param['alias'])){ |
| @@ -49,6 +51,7 @@ class BlogCategoryLogic extends BaseLogic | @@ -49,6 +51,7 @@ class BlogCategoryLogic extends BaseLogic | ||
| 49 | $id = $this->model->addReturnId($this->param); | 51 | $id = $this->model->addReturnId($this->param); |
| 50 | $route = RouteMap::setRoute($this->param['alias'], RouteMap::SOURCE_BLOG_CATE, $id, $this->user['project_id']); | 52 | $route = RouteMap::setRoute($this->param['alias'], RouteMap::SOURCE_BLOG_CATE, $id, $this->user['project_id']); |
| 51 | $this->edit(['alias'=>$route],['id'=>$id]); | 53 | $this->edit(['alias'=>$route],['id'=>$id]); |
| 54 | + $this->curlDelRoute(['new_route'=>$route]); | ||
| 52 | } | 55 | } |
| 53 | DB::commit(); | 56 | DB::commit(); |
| 54 | }catch (\Exception $e){ | 57 | }catch (\Exception $e){ |
| @@ -56,7 +59,6 @@ class BlogCategoryLogic extends BaseLogic | @@ -56,7 +59,6 @@ class BlogCategoryLogic extends BaseLogic | ||
| 56 | $this->fail('系统错误,请联系管理'); | 59 | $this->fail('系统错误,请联系管理'); |
| 57 | } | 60 | } |
| 58 | $this->addUpdateNotify(RouteMap::SOURCE_BLOG_CATE,$route); | 61 | $this->addUpdateNotify(RouteMap::SOURCE_BLOG_CATE,$route); |
| 59 | - $this->curlDelRoute(['new_route'=>$route]); | ||
| 60 | return $this->success(['id'=>$id]); | 62 | return $this->success(['id'=>$id]); |
| 61 | } | 63 | } |
| 62 | 64 |
| @@ -30,6 +30,7 @@ class BlogLogic extends BaseLogic | @@ -30,6 +30,7 @@ class BlogLogic extends BaseLogic | ||
| 30 | //拼接参数 | 30 | //拼接参数 |
| 31 | $this->param = $this->paramProcessing($this->param); | 31 | $this->param = $this->paramProcessing($this->param); |
| 32 | if(isset($this->param['id']) && !empty($this->param['id'])){ | 32 | if(isset($this->param['id']) && !empty($this->param['id'])){ |
| 33 | + $info = $this->model->read(['id'=>$this->param['id']],['id','url']); | ||
| 33 | $id = $this->param['id']; | 34 | $id = $this->param['id']; |
| 34 | $is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0 | 35 | $is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0 |
| 35 | $six_read = $this->param['six_read'] ?? 0;//是否按6.0显示 | 36 | $six_read = $this->param['six_read'] ?? 0;//是否按6.0显示 |
| @@ -38,14 +39,15 @@ class BlogLogic extends BaseLogic | @@ -38,14 +39,15 @@ class BlogLogic extends BaseLogic | ||
| 38 | } | 39 | } |
| 39 | $route = $this->param['url']; | 40 | $route = $this->param['url']; |
| 40 | $this->edit($this->param,['id'=>$id]); | 41 | $this->edit($this->param,['id'=>$id]); |
| 42 | + $this->curlDelRoute(['new_route'=>$route ?? '','old_route'=>$info['url'] ?? '']); | ||
| 41 | }else{ | 43 | }else{ |
| 42 | $this->param['sort'] = $this->setNewsSort(); | 44 | $this->param['sort'] = $this->setNewsSort(); |
| 43 | $id = $this->model->addReturnId($this->param); | 45 | $id = $this->model->addReturnId($this->param); |
| 44 | $route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_BLOG, $id, $this->user['project_id']); | 46 | $route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_BLOG, $id, $this->user['project_id']); |
| 45 | $this->edit(['url'=>$route],['id'=>$id]); | 47 | $this->edit(['url'=>$route],['id'=>$id]); |
| 48 | + $this->curlDelRoute(['new_route'=>$route]); | ||
| 46 | } | 49 | } |
| 47 | $this->addUpdateNotify(RouteMap::SOURCE_BLOG,$route); | 50 | $this->addUpdateNotify(RouteMap::SOURCE_BLOG,$route); |
| 48 | - $this->curlDelRoute(['new_route'=>$route]); | ||
| 49 | return $this->success(['id'=>$id]); | 51 | return $this->success(['id'=>$id]); |
| 50 | } | 52 | } |
| 51 | 53 |
| @@ -63,6 +63,7 @@ class NewsCategoryLogic extends BaseLogic | @@ -63,6 +63,7 @@ class NewsCategoryLogic extends BaseLogic | ||
| 63 | $this->verifyParamName($this->param['name']); | 63 | $this->verifyParamName($this->param['name']); |
| 64 | $this->param = $this->handleParam($this->param); | 64 | $this->param = $this->handleParam($this->param); |
| 65 | if(isset($this->param['id']) && !empty($this->param['id'])){ | 65 | if(isset($this->param['id']) && !empty($this->param['id'])){ |
| 66 | + $info = $this->model->read(['id'=>$this->param['id']],['id','alias']); | ||
| 66 | $id = $this->param['id']; | 67 | $id = $this->param['id']; |
| 67 | $this->param['alias'] = RouteMap::setRoute($this->param['alias'], RouteMap::SOURCE_NEWS_CATE, $id, $this->user['project_id']); | 68 | $this->param['alias'] = RouteMap::setRoute($this->param['alias'], RouteMap::SOURCE_NEWS_CATE, $id, $this->user['project_id']); |
| 68 | $route = $this->param['alias']; | 69 | $route = $this->param['alias']; |
| @@ -71,6 +72,7 @@ class NewsCategoryLogic extends BaseLogic | @@ -71,6 +72,7 @@ class NewsCategoryLogic extends BaseLogic | ||
| 71 | } | 72 | } |
| 72 | $this->param['operator_id'] = $this->user['id']; | 73 | $this->param['operator_id'] = $this->user['id']; |
| 73 | $this->edit($this->param,['id'=>$id]); | 74 | $this->edit($this->param,['id'=>$id]); |
| 75 | + $this->curlDelRoute(['new_route'=>$route ?? '','old_route'=>$info['alias'] ?? '']); | ||
| 74 | }else{ | 76 | }else{ |
| 75 | if(!isset($this->param['alias']) || empty($this->param['alias'])){ | 77 | if(!isset($this->param['alias']) || empty($this->param['alias'])){ |
| 76 | $this->param['alias'] = Translate::tran($this->param['name'], 'en'); | 78 | $this->param['alias'] = Translate::tran($this->param['name'], 'en'); |
| @@ -82,9 +84,9 @@ class NewsCategoryLogic extends BaseLogic | @@ -82,9 +84,9 @@ class NewsCategoryLogic extends BaseLogic | ||
| 82 | $id = $this->model->addReturnId($this->param); | 84 | $id = $this->model->addReturnId($this->param); |
| 83 | $route = RouteMap::setRoute($this->param['alias'], RouteMap::SOURCE_NEWS_CATE, $id, $this->user['project_id']); | 85 | $route = RouteMap::setRoute($this->param['alias'], RouteMap::SOURCE_NEWS_CATE, $id, $this->user['project_id']); |
| 84 | $this->model->edit(['alias'=>$route],['id'=>$id]); | 86 | $this->model->edit(['alias'=>$route],['id'=>$id]); |
| 87 | + $this->curlDelRoute(['new_route'=>$route]); | ||
| 85 | } | 88 | } |
| 86 | $this->addUpdateNotify(RouteMap::SOURCE_NEWS_CATE,$route); | 89 | $this->addUpdateNotify(RouteMap::SOURCE_NEWS_CATE,$route); |
| 87 | - $this->curlDelRoute(['new_route'=>$route]); | ||
| 88 | return $this->success(['id'=>$id]); | 90 | return $this->success(['id'=>$id]); |
| 89 | } | 91 | } |
| 90 | 92 |
| @@ -61,6 +61,7 @@ class NewsLogic extends BaseLogic | @@ -61,6 +61,7 @@ class NewsLogic extends BaseLogic | ||
| 61 | { | 61 | { |
| 62 | $this->param = $this->paramProcessing($this->param); | 62 | $this->param = $this->paramProcessing($this->param); |
| 63 | if (isset($this->param['id']) && !empty($this->param['id'])) { | 63 | if (isset($this->param['id']) && !empty($this->param['id'])) { |
| 64 | + $info = $this->model->read(['id'=>$this->param['id']],['id','url']); | ||
| 64 | $id = $this->param['id']; | 65 | $id = $this->param['id']; |
| 65 | $is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0 | 66 | $is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0 |
| 66 | $six_read = $this->param['six_read'] ?? 0;//是否按6.0显示 | 67 | $six_read = $this->param['six_read'] ?? 0;//是否按6.0显示 |
| @@ -70,14 +71,15 @@ class NewsLogic extends BaseLogic | @@ -70,14 +71,15 @@ class NewsLogic extends BaseLogic | ||
| 70 | //是否更新路由 | 71 | //是否更新路由 |
| 71 | $route = $this->param['url']; | 72 | $route = $this->param['url']; |
| 72 | $this->edit($this->param, ['id' => $id]); | 73 | $this->edit($this->param, ['id' => $id]); |
| 74 | + $this->curlDelRoute(['new_route'=>$route ?? '','old_route'=>$info['url'] ?? '']); | ||
| 73 | } else { | 75 | } else { |
| 74 | $this->param['sort'] = $this->setNewsSort(); | 76 | $this->param['sort'] = $this->setNewsSort(); |
| 75 | $id = $this->model->addReturnId($this->param); | 77 | $id = $this->model->addReturnId($this->param); |
| 76 | $route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_NEWS, $id, $this->user['project_id']); | 78 | $route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_NEWS, $id, $this->user['project_id']); |
| 77 | $this->edit(['url' => $route], ['id' => $id]); | 79 | $this->edit(['url' => $route], ['id' => $id]); |
| 80 | + $this->curlDelRoute(['new_route'=>$route]); | ||
| 78 | } | 81 | } |
| 79 | $this->addUpdateNotify(RouteMap::SOURCE_NEWS,$route); | 82 | $this->addUpdateNotify(RouteMap::SOURCE_NEWS,$route); |
| 80 | - $this->curlDelRoute(['new_route'=>$route]); | ||
| 81 | return $this->success(['id'=>$id]); | 83 | return $this->success(['id'=>$id]); |
| 82 | } | 84 | } |
| 83 | 85 |
-
请 注册 或 登录 后发表评论