|
@@ -6,6 +6,7 @@ use App\Helper\Arr; |
|
@@ -6,6 +6,7 @@ use App\Helper\Arr; |
|
6
|
use App\Http\Logic\Bside\BaseLogic;
|
6
|
use App\Http\Logic\Bside\BaseLogic;
|
|
7
|
use App\Models\Product\Category;
|
7
|
use App\Models\Product\Category;
|
|
8
|
use App\Models\Product\CategoryRelated;
|
8
|
use App\Models\Product\CategoryRelated;
|
|
|
|
9
|
+use App\Models\Product\Keyword;
|
|
9
|
use App\Models\Product\Product;
|
10
|
use App\Models\Product\Product;
|
|
10
|
use App\Models\RouteMap\RouteMap;
|
11
|
use App\Models\RouteMap\RouteMap;
|
|
11
|
use App\Models\Template\BTemplate;
|
12
|
use App\Models\Template\BTemplate;
|
|
@@ -66,6 +67,53 @@ class ProductLogic extends BaseLogic |
|
@@ -66,6 +67,53 @@ class ProductLogic extends BaseLogic |
|
66
|
}
|
67
|
}
|
|
67
|
|
68
|
|
|
68
|
/**
|
69
|
/**
|
|
|
|
70
|
+ * @remark :编辑列表数据
|
|
|
|
71
|
+ * @name :editList
|
|
|
|
72
|
+ * @author :lyh
|
|
|
|
73
|
+ * @method :post
|
|
|
|
74
|
+ * @time :2023/10/26 9:49
|
|
|
|
75
|
+ */
|
|
|
|
76
|
+ public function editList(){
|
|
|
|
77
|
+ if(isset($param['category_id']) && !empty($param['category_id'])){
|
|
|
|
78
|
+ $param['category_id'] = $this->getLastCategory($param['category_id']);
|
|
|
|
79
|
+ }
|
|
|
|
80
|
+ if(isset($param['keyword_id']) && !empty($param['keyword_id'])){
|
|
|
|
81
|
+ $param['keyword_id'] = ','.Arr::arrToSet($param['keyword_id']).',';
|
|
|
|
82
|
+ }
|
|
|
|
83
|
+ }
|
|
|
|
84
|
+
|
|
|
|
85
|
+ /**
|
|
|
|
86
|
+ * @remark :保存关键字标签处理
|
|
|
|
87
|
+ * @name :saveKeyword
|
|
|
|
88
|
+ * @author :lyh
|
|
|
|
89
|
+ * @method :post
|
|
|
|
90
|
+ * @time :2023/10/26 9:51
|
|
|
|
91
|
+ */
|
|
|
|
92
|
+ public function saveKeyword($keyword){
|
|
|
|
93
|
+ $str = '';
|
|
|
|
94
|
+ if(!empty($keyword) && is_array($keyword)){
|
|
|
|
95
|
+ $keywordModel = new Keyword();
|
|
|
|
96
|
+ foreach ($keyword as $v){
|
|
|
|
97
|
+ //查询当前关键字是否存在
|
|
|
|
98
|
+ $info = $keywordModel->read(['title'=>$v],['id']);
|
|
|
|
99
|
+ if($info === false){
|
|
|
|
100
|
+ $param['project_id'] = $this->user['project_id'];
|
|
|
|
101
|
+ $param['created_at'] = date('Y-m-d H:i:s');
|
|
|
|
102
|
+ $param['updated_at'] = $param['created_at'];
|
|
|
|
103
|
+ $param['title'] = $v;
|
|
|
|
104
|
+ $id = $this->model->insertGetId($param);
|
|
|
|
105
|
+ $route = RouteMap::setRoute($v, RouteMap::SOURCE_PRODUCT_KEYWORD, $id, $this->user['project_id']);
|
|
|
|
106
|
+ $this->model->edit(['route'=>$route],['id'=>$id]);
|
|
|
|
107
|
+ $str .= $id.',';
|
|
|
|
108
|
+ }else{
|
|
|
|
109
|
+ $str .= $info['id'];
|
|
|
|
110
|
+ }
|
|
|
|
111
|
+ }
|
|
|
|
112
|
+ }
|
|
|
|
113
|
+ return $str;
|
|
|
|
114
|
+ }
|
|
|
|
115
|
+
|
|
|
|
116
|
+ /**
|
|
69
|
* @remark :不使用save处理参数
|
117
|
* @remark :不使用save处理参数
|
|
70
|
* @name :handleSaveParam
|
118
|
* @name :handleSaveParam
|
|
71
|
* @author :lyh
|
119
|
* @author :lyh
|