|
...
|
...
|
@@ -121,6 +121,8 @@ class ProductLogic extends BaseLogic |
|
|
|
$info = $this->model->read(['id'=>$this->param['id']]);
|
|
|
|
$param = $this->setProductParams($info);
|
|
|
|
$save_id = $this->model->insertGetId($param);
|
|
|
|
//同步路由信息
|
|
|
|
$this->copyRoute($save_id,$param['route'].'-'.$save_id);
|
|
|
|
//同步关联分类
|
|
|
|
CategoryRelated::saveRelated($save_id, explode(",", $param['category_id']));
|
|
|
|
//同步关联关键词
|
|
...
|
...
|
@@ -154,6 +156,24 @@ class ProductLogic extends BaseLogic |
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :同步路由表
|
|
|
|
* @name :copyRoute
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/8/19 11:53
|
|
|
|
*/
|
|
|
|
public function copyRoute($news_id,$new_route){
|
|
|
|
$routeModel = new RouteMap();
|
|
|
|
$data = [
|
|
|
|
'source'=>$routeModel::SOURCE_PRODUCT,
|
|
|
|
'source_id'=>$news_id,
|
|
|
|
'project_id'=>$this->user['project_id'],
|
|
|
|
'route'=>$new_route,
|
|
|
|
];
|
|
|
|
return $routeModel->add($data);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :组装模版数据
|
|
|
|
* @name :setTemplateParams
|
|
|
|
* @author :lyh
|
|
...
|
...
|
@@ -208,6 +228,7 @@ class ProductLogic extends BaseLogic |
|
|
|
'product_type'=>$info['product_type'],
|
|
|
|
'created_uid'=>$this->user['id'],
|
|
|
|
'icon'=>Arr::a2s($info['icon']),
|
|
|
|
'route'=>$info['route']."-copy",
|
|
|
|
'created_at'=>date('Y-m-d H:i:s'),
|
|
|
|
'updated_at'=>date('Y-m-d H:i:s'),
|
|
|
|
];
|
...
|
...
|
|