正在显示
3 个修改的文件
包含
48 行增加
和
0 行删除
| @@ -38,6 +38,7 @@ class BlogLogic extends BaseLogic | @@ -38,6 +38,7 @@ class BlogLogic extends BaseLogic | ||
| 38 | $route = $this->param['url']; | 38 | $route = $this->param['url']; |
| 39 | $this->edit($this->param,['id'=>$this->param['id']]); | 39 | $this->edit($this->param,['id'=>$this->param['id']]); |
| 40 | }else{ | 40 | }else{ |
| 41 | + $this->param['sort'] = $this->setNewsSort(); | ||
| 41 | $id = $this->model->addReturnId($this->param); | 42 | $id = $this->model->addReturnId($this->param); |
| 42 | $route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_BLOG, $id, $this->user['project_id']); | 43 | $route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_BLOG, $id, $this->user['project_id']); |
| 43 | $this->edit(['url'=>$route],['id'=>$id]); | 44 | $this->edit(['url'=>$route],['id'=>$id]); |
| @@ -53,6 +54,21 @@ class BlogLogic extends BaseLogic | @@ -53,6 +54,21 @@ class BlogLogic extends BaseLogic | ||
| 53 | } | 54 | } |
| 54 | 55 | ||
| 55 | /** | 56 | /** |
| 57 | + * @remark :设置最新产品的sort排序 | ||
| 58 | + * @name :setNewsSort | ||
| 59 | + * @author :lyh | ||
| 60 | + * @method :post | ||
| 61 | + * @time :2023/12/25 9:27 | ||
| 62 | + */ | ||
| 63 | + public function setNewsSort(){ | ||
| 64 | + $info = $this->model->select(['id','sort'])->orderBy('sort','desc')->first(); | ||
| 65 | + if($info === false){ | ||
| 66 | + return 1; | ||
| 67 | + } | ||
| 68 | + return $info['sort']++; | ||
| 69 | + } | ||
| 70 | + | ||
| 71 | + /** | ||
| 56 | * @name :编辑seo | 72 | * @name :编辑seo |
| 57 | * @return void | 73 | * @return void |
| 58 | * @author :liyuhang | 74 | * @author :liyuhang |
| @@ -149,6 +149,7 @@ class CustomModuleContentLogic extends BaseLogic | @@ -149,6 +149,7 @@ class CustomModuleContentLogic extends BaseLogic | ||
| 149 | */ | 149 | */ |
| 150 | public function contentAdd(){ | 150 | public function contentAdd(){ |
| 151 | try { | 151 | try { |
| 152 | + $this->param['sort'] = $this->setNewsSort(); | ||
| 152 | $id = $this->model->addReturnId($this->param); | 153 | $id = $this->model->addReturnId($this->param); |
| 153 | $route = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_MODULE, | 154 | $route = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_MODULE, |
| 154 | $id, $this->user['project_id']); | 155 | $id, $this->user['project_id']); |
| @@ -162,6 +163,21 @@ class CustomModuleContentLogic extends BaseLogic | @@ -162,6 +163,21 @@ class CustomModuleContentLogic extends BaseLogic | ||
| 162 | } | 163 | } |
| 163 | 164 | ||
| 164 | /** | 165 | /** |
| 166 | + * @remark :设置最新产品的sort排序 | ||
| 167 | + * @name :setNewsSort | ||
| 168 | + * @author :lyh | ||
| 169 | + * @method :post | ||
| 170 | + * @time :2023/12/25 9:27 | ||
| 171 | + */ | ||
| 172 | + public function setNewsSort(){ | ||
| 173 | + $info = $this->model->select(['id','sort'])->orderBy('sort','desc')->first(); | ||
| 174 | + if($info === false){ | ||
| 175 | + return 1; | ||
| 176 | + } | ||
| 177 | + return $info['sort']++; | ||
| 178 | + } | ||
| 179 | + | ||
| 180 | + /** | ||
| 165 | * @remark :编辑数据 | 181 | * @remark :编辑数据 |
| 166 | * @name :contentEdit | 182 | * @name :contentEdit |
| 167 | * @author :lyh | 183 | * @author :lyh |
| @@ -68,6 +68,7 @@ class NewsLogic extends BaseLogic | @@ -68,6 +68,7 @@ class NewsLogic extends BaseLogic | ||
| 68 | $route = $this->param['url']; | 68 | $route = $this->param['url']; |
| 69 | $this->edit($this->param, ['id' => $this->param['id']]); | 69 | $this->edit($this->param, ['id' => $this->param['id']]); |
| 70 | } else { | 70 | } else { |
| 71 | + $this->param['sort'] = $this->setNewsSort(); | ||
| 71 | $id = $this->model->addReturnId($this->param); | 72 | $id = $this->model->addReturnId($this->param); |
| 72 | $route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_NEWS, $id, $this->user['project_id']); | 73 | $route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_NEWS, $id, $this->user['project_id']); |
| 73 | $this->edit(['url' => $route], ['id' => $id]); | 74 | $this->edit(['url' => $route], ['id' => $id]); |
| @@ -84,6 +85,21 @@ class NewsLogic extends BaseLogic | @@ -84,6 +85,21 @@ class NewsLogic extends BaseLogic | ||
| 84 | } | 85 | } |
| 85 | 86 | ||
| 86 | /** | 87 | /** |
| 88 | + * @remark :设置最新产品的sort排序 | ||
| 89 | + * @name :setNewsSort | ||
| 90 | + * @author :lyh | ||
| 91 | + * @method :post | ||
| 92 | + * @time :2023/12/25 9:27 | ||
| 93 | + */ | ||
| 94 | + public function setNewsSort(){ | ||
| 95 | + $info = $this->model->select(['id','sort'])->orderBy('sort','desc')->first(); | ||
| 96 | + if($info === false){ | ||
| 97 | + return 1; | ||
| 98 | + } | ||
| 99 | + return $info['sort']++; | ||
| 100 | + } | ||
| 101 | + | ||
| 102 | + /** | ||
| 87 | * @name :编辑seo | 103 | * @name :编辑seo |
| 88 | * @return void | 104 | * @return void |
| 89 | * @author :liyuhang | 105 | * @author :liyuhang |
-
请 注册 或 登录 后发表评论