|
@@ -56,7 +56,9 @@ class ProductLogic extends BaseLogic |
|
@@ -56,7 +56,9 @@ class ProductLogic extends BaseLogic |
|
56
|
$id = $this->param['id'];
|
56
|
$id = $this->param['id'];
|
|
57
|
}else{
|
57
|
}else{
|
|
58
|
$this->param = $this->addHandleParam($this->param);
|
58
|
$this->param = $this->addHandleParam($this->param);
|
|
59
|
- $this->param['sort'] = $this->setNewsSort();
|
59
|
+ if($this->user['project_id'] != 2059){//2059项目不处理排序
|
|
|
|
60
|
+ $this->param['sort'] = $this->setProductSort();
|
|
|
|
61
|
+ }
|
|
60
|
$id = $this->model->addReturnId($this->param);
|
62
|
$id = $this->model->addReturnId($this->param);
|
|
61
|
$route = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_PRODUCT, $id, $this->user['project_id']);
|
63
|
$route = RouteMap::setRoute($this->param['route'], RouteMap::SOURCE_PRODUCT, $id, $this->user['project_id']);
|
|
62
|
$this->model->edit(['route'=>$route],['id'=>$id]);
|
64
|
$this->model->edit(['route'=>$route],['id'=>$id]);
|
|
@@ -81,7 +83,7 @@ class ProductLogic extends BaseLogic |
|
@@ -81,7 +83,7 @@ class ProductLogic extends BaseLogic |
|
81
|
* @method :post
|
83
|
* @method :post
|
|
82
|
* @time :2023/12/25 9:27
|
84
|
* @time :2023/12/25 9:27
|
|
83
|
*/
|
85
|
*/
|
|
84
|
- public function setNewsSort(){
|
86
|
+ public function setProductSort(){
|
|
85
|
$info = $this->model->orderBy('sort','desc')->first();
|
87
|
$info = $this->model->orderBy('sort','desc')->first();
|
|
86
|
if(empty($info)){
|
88
|
if(empty($info)){
|
|
87
|
return 1;
|
89
|
return 1;
|
|
@@ -948,8 +950,18 @@ class ProductLogic extends BaseLogic |
|
@@ -948,8 +950,18 @@ class ProductLogic extends BaseLogic |
|
948
|
* @time :2024/9/20 16:48
|
950
|
* @time :2024/9/20 16:48
|
|
949
|
*/
|
951
|
*/
|
|
950
|
public function batchSetKeyword(){
|
952
|
public function batchSetKeyword(){
|
|
951
|
- $this->param['keyword_id'] = ','.implode(',',$this->param['keyword_id']).',';
|
|
|
|
952
|
- $this->edit(['keyword_id'=>$this->param['keyword_id']],['id'=>['in',$this->param['id']]]);
|
953
|
+ if(isset($this->param['is_cover']) && $this->param['is_cover'] == 1){//覆盖
|
|
|
|
954
|
+ $this->param['keyword_id'] = ','.implode(',',$this->param['keyword_id']).',';
|
|
|
|
955
|
+ $this->edit(['keyword_id'=>$this->param['keyword_id']],['id'=>['in',$this->param['id']]]);
|
|
|
|
956
|
+ }else{
|
|
|
|
957
|
+ foreach ($this->param['id'] as $id){
|
|
|
|
958
|
+ //获取当前产品的分类
|
|
|
|
959
|
+ $productInfo = $this->model->read(['id'=>$id],['id','keyword_id']);
|
|
|
|
960
|
+ $keyword_ids_arr = array_values(array_unique(array_merge($productInfo['keyword_id'],$this->param['keyword_id'])));
|
|
|
|
961
|
+ $keyword_ids = ','.implode(',',$keyword_ids_arr).',';
|
|
|
|
962
|
+ $this->model->edit(['keyword_id'=>$keyword_ids],['id'=>$id]);
|
|
|
|
963
|
+ }
|
|
|
|
964
|
+ }
|
|
953
|
return $this->success();
|
965
|
return $this->success();
|
|
954
|
}
|
966
|
}
|
|
955
|
} |
967
|
} |