|
@@ -121,6 +121,8 @@ class ProductLogic extends BaseLogic |
|
@@ -121,6 +121,8 @@ class ProductLogic extends BaseLogic |
|
121
|
$info = $this->model->read(['id'=>$this->param['id']]);
|
121
|
$info = $this->model->read(['id'=>$this->param['id']]);
|
|
122
|
$param = $this->setProductParams($info);
|
122
|
$param = $this->setProductParams($info);
|
|
123
|
$save_id = $this->model->insertGetId($param);
|
123
|
$save_id = $this->model->insertGetId($param);
|
|
|
|
124
|
+ //同步路由信息
|
|
|
|
125
|
+ $this->copyRoute($save_id,$param['route'].'-'.$save_id);
|
|
124
|
//同步关联分类
|
126
|
//同步关联分类
|
|
125
|
CategoryRelated::saveRelated($save_id, explode(",", $param['category_id']));
|
127
|
CategoryRelated::saveRelated($save_id, explode(",", $param['category_id']));
|
|
126
|
//同步关联关键词
|
128
|
//同步关联关键词
|
|
@@ -154,6 +156,24 @@ class ProductLogic extends BaseLogic |
|
@@ -154,6 +156,24 @@ class ProductLogic extends BaseLogic |
|
154
|
}
|
156
|
}
|
|
155
|
|
157
|
|
|
156
|
/**
|
158
|
/**
|
|
|
|
159
|
+ * @remark :同步路由表
|
|
|
|
160
|
+ * @name :copyRoute
|
|
|
|
161
|
+ * @author :lyh
|
|
|
|
162
|
+ * @method :post
|
|
|
|
163
|
+ * @time :2023/8/19 11:53
|
|
|
|
164
|
+ */
|
|
|
|
165
|
+ public function copyRoute($news_id,$new_route){
|
|
|
|
166
|
+ $routeModel = new RouteMap();
|
|
|
|
167
|
+ $data = [
|
|
|
|
168
|
+ 'source'=>$routeModel::SOURCE_PRODUCT,
|
|
|
|
169
|
+ 'source_id'=>$news_id,
|
|
|
|
170
|
+ 'project_id'=>$this->user['project_id'],
|
|
|
|
171
|
+ 'route'=>$new_route,
|
|
|
|
172
|
+ ];
|
|
|
|
173
|
+ return $routeModel->add($data);
|
|
|
|
174
|
+ }
|
|
|
|
175
|
+
|
|
|
|
176
|
+ /**
|
|
157
|
* @remark :组装模版数据
|
177
|
* @remark :组装模版数据
|
|
158
|
* @name :setTemplateParams
|
178
|
* @name :setTemplateParams
|
|
159
|
* @author :lyh
|
179
|
* @author :lyh
|
|
@@ -208,6 +228,7 @@ class ProductLogic extends BaseLogic |
|
@@ -208,6 +228,7 @@ class ProductLogic extends BaseLogic |
|
208
|
'product_type'=>$info['product_type'],
|
228
|
'product_type'=>$info['product_type'],
|
|
209
|
'created_uid'=>$this->user['id'],
|
229
|
'created_uid'=>$this->user['id'],
|
|
210
|
'icon'=>Arr::a2s($info['icon']),
|
230
|
'icon'=>Arr::a2s($info['icon']),
|
|
|
|
231
|
+ 'route'=>$info['route']."-copy",
|
|
211
|
'created_at'=>date('Y-m-d H:i:s'),
|
232
|
'created_at'=>date('Y-m-d H:i:s'),
|
|
212
|
'updated_at'=>date('Y-m-d H:i:s'),
|
233
|
'updated_at'=>date('Y-m-d H:i:s'),
|
|
213
|
];
|
234
|
];
|