正在显示
1 个修改的文件
包含
12 行增加
和
14 行删除
| @@ -154,9 +154,7 @@ class ProductLogic extends BaseLogic | @@ -154,9 +154,7 @@ 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 | - $this->model->fill($param); | ||
| 158 | - $newProduct = $this->model->save($param); | ||
| 159 | - $save_id = $newProduct->id; | 157 | + $save_id = $this->model->insertGetId($param); |
| 160 | //同步关联分类 | 158 | //同步关联分类 |
| 161 | CategoryRelated::saveRelated($save_id, $param['category_id']); | 159 | CategoryRelated::saveRelated($save_id, $param['category_id']); |
| 162 | //同步关联关键词 | 160 | //同步关联关键词 |
| @@ -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'=>$info['thumb'], | ||
| 231 | - 'gallery'=>$info['gallery'], | ||
| 232 | - 'attrs'=>$info['attrs'], | ||
| 233 | - 'attr_id'=>$info['attr_id'], | ||
| 234 | - 'category_id'=>$info['category_id'], | ||
| 235 | - 'keyword_id'=>$info['keyword_id'], | 228 | + 'thumb'=>json_encode($info['thumb']), |
| 229 | + 'gallery'=>json_encode($info['gallery']), | ||
| 230 | + 'attrs'=>json_encode($info['attrs']), | ||
| 231 | + 'attr_id'=>json_encode($info['attr_id']), | ||
| 232 | + 'category_id'=>json_encode($info['category_id']), | ||
| 233 | + 'keyword_id'=>json_encode($info['keyword_id']), | ||
| 236 | 'intro'=>$info['intro'], | 234 | 'intro'=>$info['intro'], |
| 237 | 'content'=>$info['content'], | 235 | 'content'=>$info['content'], |
| 238 | - 'describe'=>$info['describe'], | ||
| 239 | - 'describe_id'=>$info['describe_id'], | ||
| 240 | - 'seo_mate'=>$info['seo_mate'], | ||
| 241 | - 'related_product_id'=>$info['related_product_id'], | 236 | + 'describe'=>json_encode(info['describe']), |
| 237 | + 'describe_id'=>json_encode($info['describe_id']), | ||
| 238 | + 'seo_mate'=>json_encode($info['seo_mate']), | ||
| 239 | + 'related_product_id'=>json_encode($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'=>$info['icon'], | 244 | + 'icon'=>json_encode($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 | ]; |
-
请 注册 或 登录 后发表评论