正在显示
1 个修改的文件
包含
13 行增加
和
15 行删除
| @@ -154,13 +154,11 @@ class ProductLogic extends BaseLogic | @@ -154,13 +154,11 @@ class ProductLogic extends BaseLogic | ||
| 154 | public function setCopyProduct(){ | 154 | public function setCopyProduct(){ |
| 155 | $info = $this->model->read(['id'=>$this->param['id']]); | 155 | $info = $this->model->read(['id'=>$this->param['id']]); |
| 156 | $param = $this->setProductParams($info); | 156 | $param = $this->setProductParams($info); |
| 157 | - var_dump($param['category_id']); | ||
| 158 | - die(); | ||
| 159 | $save_id = $this->model->insertGetId($param); | 157 | $save_id = $this->model->insertGetId($param); |
| 160 | //同步关联分类 | 158 | //同步关联分类 |
| 161 | - CategoryRelated::saveRelated($save_id, $param['category_id']); | 159 | + CategoryRelated::saveRelated($save_id, explode(",", $param['category_id'])); |
| 162 | //同步关联关键词 | 160 | //同步关联关键词 |
| 163 | - KeywordRelated::saveRelated($save_id, $param['keyword_id']); | 161 | + KeywordRelated::saveRelated($save_id,explode(",", $param['keyword_id'])); |
| 164 | //同步可视化装修数据 | 162 | //同步可视化装修数据 |
| 165 | $this->copyTemplate($this->param['id'],$info['project_id'],$save_id); | 163 | $this->copyTemplate($this->param['id'],$info['project_id'],$save_id); |
| 166 | return $this->success(); | 164 | return $this->success(); |
| @@ -227,23 +225,23 @@ class ProductLogic extends BaseLogic | @@ -227,23 +225,23 @@ class ProductLogic extends BaseLogic | ||
| 227 | $param = [ | 225 | $param = [ |
| 228 | 'project_id'=>$info['project_id'], | 226 | 'project_id'=>$info['project_id'], |
| 229 | 'title'=>$info['title'], | 227 | 'title'=>$info['title'], |
| 230 | - 'thumb'=>json_encode($info['thumb']), | ||
| 231 | - 'gallery'=>json_encode($info['gallery']), | ||
| 232 | - 'attrs'=>json_encode($info['attrs']), | ||
| 233 | - 'attr_id'=>json_encode($info['attr_id']), | ||
| 234 | - 'category_id'=>json_encode($info['category_id']), | ||
| 235 | - 'keyword_id'=>json_encode($info['keyword_id']), | 228 | + 'thumb'=>Arr::a2s($info['thumb']), |
| 229 | + 'gallery'=>Arr::a2s($info['gallery']), | ||
| 230 | + 'attrs'=>Arr::a2s($info['attrs']), | ||
| 231 | + 'attr_id'=>Arr::arrToSet($info['attr_id']), | ||
| 232 | + 'category_id'=>Arr::arrToSet($info['category_id']), | ||
| 233 | + 'keyword_id'=>Arr::arrToSet($info['keyword_id']), | ||
| 236 | 'intro'=>$info['intro'], | 234 | 'intro'=>$info['intro'], |
| 237 | 'content'=>$info['content'], | 235 | 'content'=>$info['content'], |
| 238 | - 'describe'=>json_encode($info['describe']), | ||
| 239 | - 'describe_id'=>json_encode($info['describe_id']), | ||
| 240 | - 'seo_mate'=>json_encode($info['seo_mate']), | ||
| 241 | - 'related_product_id'=>json_encode($info['related_product_id']), | 236 | + 'describe'=>Arr::a2s($info['describe']), |
| 237 | + 'describe_id'=>Arr::arrToSet($info['describe_id']), | ||
| 238 | + 'seo_mate'=>Arr::a2s($info['seo_mate']), | ||
| 239 | + 'related_product_id'=>Arr::arrToSet($info['related_product_id']), | ||
| 242 | 'sort'=>$info['sort'], | 240 | 'sort'=>$info['sort'], |
| 243 | 'status'=>$info['status'], | 241 | 'status'=>$info['status'], |
| 244 | 'product_type'=>$info['product_type'], | 242 | 'product_type'=>$info['product_type'], |
| 245 | 'created_uid'=>$this->user['id'], | 243 | 'created_uid'=>$this->user['id'], |
| 246 | - 'icon'=>json_encode($info['icon']), | 244 | + 'icon'=>Arr::a2s($info['icon']), |
| 247 | 'created_at'=>date('Y-m-d H:i:s'), | 245 | 'created_at'=>date('Y-m-d H:i:s'), |
| 248 | 'updated_at'=>date('Y-m-d H:i:s'), | 246 | 'updated_at'=>date('Y-m-d H:i:s'), |
| 249 | ]; | 247 | ]; |
-
请 注册 或 登录 后发表评论