|
...
|
...
|
@@ -154,13 +154,11 @@ class ProductLogic extends BaseLogic |
|
|
|
public function setCopyProduct(){
|
|
|
|
$info = $this->model->read(['id'=>$this->param['id']]);
|
|
|
|
$param = $this->setProductParams($info);
|
|
|
|
var_dump($param['category_id']);
|
|
|
|
die();
|
|
|
|
$save_id = $this->model->insertGetId($param);
|
|
|
|
//同步关联分类
|
|
|
|
CategoryRelated::saveRelated($save_id, $param['category_id']);
|
|
|
|
CategoryRelated::saveRelated($save_id, explode(",", $param['category_id']));
|
|
|
|
//同步关联关键词
|
|
|
|
KeywordRelated::saveRelated($save_id, $param['keyword_id']);
|
|
|
|
KeywordRelated::saveRelated($save_id,explode(",", $param['keyword_id']));
|
|
|
|
//同步可视化装修数据
|
|
|
|
$this->copyTemplate($this->param['id'],$info['project_id'],$save_id);
|
|
|
|
return $this->success();
|
|
...
|
...
|
@@ -227,23 +225,23 @@ class ProductLogic extends BaseLogic |
|
|
|
$param = [
|
|
|
|
'project_id'=>$info['project_id'],
|
|
|
|
'title'=>$info['title'],
|
|
|
|
'thumb'=>json_encode($info['thumb']),
|
|
|
|
'gallery'=>json_encode($info['gallery']),
|
|
|
|
'attrs'=>json_encode($info['attrs']),
|
|
|
|
'attr_id'=>json_encode($info['attr_id']),
|
|
|
|
'category_id'=>json_encode($info['category_id']),
|
|
|
|
'keyword_id'=>json_encode($info['keyword_id']),
|
|
|
|
'thumb'=>Arr::a2s($info['thumb']),
|
|
|
|
'gallery'=>Arr::a2s($info['gallery']),
|
|
|
|
'attrs'=>Arr::a2s($info['attrs']),
|
|
|
|
'attr_id'=>Arr::arrToSet($info['attr_id']),
|
|
|
|
'category_id'=>Arr::arrToSet($info['category_id']),
|
|
|
|
'keyword_id'=>Arr::arrToSet($info['keyword_id']),
|
|
|
|
'intro'=>$info['intro'],
|
|
|
|
'content'=>$info['content'],
|
|
|
|
'describe'=>json_encode($info['describe']),
|
|
|
|
'describe_id'=>json_encode($info['describe_id']),
|
|
|
|
'seo_mate'=>json_encode($info['seo_mate']),
|
|
|
|
'related_product_id'=>json_encode($info['related_product_id']),
|
|
|
|
'describe'=>Arr::a2s($info['describe']),
|
|
|
|
'describe_id'=>Arr::arrToSet($info['describe_id']),
|
|
|
|
'seo_mate'=>Arr::a2s($info['seo_mate']),
|
|
|
|
'related_product_id'=>Arr::arrToSet($info['related_product_id']),
|
|
|
|
'sort'=>$info['sort'],
|
|
|
|
'status'=>$info['status'],
|
|
|
|
'product_type'=>$info['product_type'],
|
|
|
|
'created_uid'=>$this->user['id'],
|
|
|
|
'icon'=>json_encode($info['icon']),
|
|
|
|
'icon'=>Arr::a2s($info['icon']),
|
|
|
|
'created_at'=>date('Y-m-d H:i:s'),
|
|
|
|
'updated_at'=>date('Y-m-d H:i:s'),
|
|
|
|
];
|
...
|
...
|
|