正在显示
1 个修改的文件
包含
2 行增加
和
1 行删除
| @@ -52,6 +52,7 @@ class ProductLogic extends BaseLogic | @@ -52,6 +52,7 @@ class ProductLogic extends BaseLogic | ||
| 52 | $id = $this->param['id']; | 52 | $id = $this->param['id']; |
| 53 | }else{ | 53 | }else{ |
| 54 | $this->param = $this->addHandleParam($this->param); | 54 | $this->param = $this->addHandleParam($this->param); |
| 55 | + $this->param['sort'] = $this->setNewsSort(); | ||
| 55 | $id = $this->model->addReturnId($this->param); | 56 | $id = $this->model->addReturnId($this->param); |
| 56 | $route = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_PRODUCT, $id, $this->user['project_id']); | 57 | $route = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_PRODUCT, $id, $this->user['project_id']); |
| 57 | $this->model->edit(['route'=>$route],['id'=>$id]); | 58 | $this->model->edit(['route'=>$route],['id'=>$id]); |
| @@ -76,7 +77,7 @@ class ProductLogic extends BaseLogic | @@ -76,7 +77,7 @@ class ProductLogic extends BaseLogic | ||
| 76 | * @time :2023/12/25 9:27 | 77 | * @time :2023/12/25 9:27 |
| 77 | */ | 78 | */ |
| 78 | public function setNewsSort(){ | 79 | public function setNewsSort(){ |
| 79 | - $info = $this->model->orderBy('sort','desc')->first(); | 80 | + $info = $this->model->select(['id','sort'])->orderBy('sort','desc')->first(); |
| 80 | if($info === false){ | 81 | if($info === false){ |
| 81 | return 1; | 82 | return 1; |
| 82 | } | 83 | } |
-
请 注册 或 登录 后发表评论