|
...
|
...
|
@@ -68,6 +68,7 @@ class NewsLogic extends BaseLogic |
|
|
|
$route = $this->param['url'];
|
|
|
|
$this->edit($this->param, ['id' => $this->param['id']]);
|
|
|
|
} else {
|
|
|
|
$this->param['sort'] = $this->setNewsSort();
|
|
|
|
$id = $this->model->addReturnId($this->param);
|
|
|
|
$route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_NEWS, $id, $this->user['project_id']);
|
|
|
|
$this->edit(['url' => $route], ['id' => $id]);
|
|
...
|
...
|
@@ -84,6 +85,21 @@ class NewsLogic extends BaseLogic |
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :设置最新产品的sort排序
|
|
|
|
* @name :setNewsSort
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/12/25 9:27
|
|
|
|
*/
|
|
|
|
public function setNewsSort(){
|
|
|
|
$info = $this->model->select(['id','sort'])->orderBy('sort','desc')->first();
|
|
|
|
if($info === false){
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return $info['sort']++;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name :编辑seo
|
|
|
|
* @return void
|
|
|
|
* @author :liyuhang
|
...
|
...
|
|