正在显示
1 个修改的文件
包含
25 行增加
和
0 行删除
| @@ -531,6 +531,7 @@ class ProductLogic extends BaseLogic | @@ -531,6 +531,7 @@ class ProductLogic extends BaseLogic | ||
| 531 | //同步扩展字段 | 531 | //同步扩展字段 |
| 532 | $this->copyExtendInfo($info['id'],$save_id); | 532 | $this->copyExtendInfo($info['id'],$save_id); |
| 533 | $this->copyColumn($info['id'],$save_id); | 533 | $this->copyColumn($info['id'],$save_id); |
| 534 | + $this->copyDetail($info['id'],$save_id); | ||
| 534 | DB::commit(); | 535 | DB::commit(); |
| 535 | }catch (\Exception $e){ | 536 | }catch (\Exception $e){ |
| 536 | DB::rollBack(); | 537 | DB::rollBack(); |
| @@ -577,6 +578,30 @@ class ProductLogic extends BaseLogic | @@ -577,6 +578,30 @@ class ProductLogic extends BaseLogic | ||
| 577 | } | 578 | } |
| 578 | 579 | ||
| 579 | /** | 580 | /** |
| 581 | + * @remark :复制描述 | ||
| 582 | + * @name :copyDetail | ||
| 583 | + * @author :lyh | ||
| 584 | + * @method :post | ||
| 585 | + * @time :2024/12/18 16:02 | ||
| 586 | + */ | ||
| 587 | + public function copyDetail($product_id,$new_product_id){ | ||
| 588 | + $detailModel = new Detail(); | ||
| 589 | + $detailList = $detailModel->list(['product_id'=>$product_id,'column_id'=>1]); | ||
| 590 | + if(!empty($detailList)){ | ||
| 591 | + $data = []; | ||
| 592 | + foreach ($detailList as $k => $v){ | ||
| 593 | + unset($v['id']); | ||
| 594 | + $v['css'] = Arr::a2s($v['css']); | ||
| 595 | + $v['content'] = Arr::a2s($v['content']); | ||
| 596 | + $v['product_id'] = $new_product_id; | ||
| 597 | + $v['created_at'] = date('Y-m-d H:i:s'); | ||
| 598 | + $v['updated_at'] = date('Y-m-d H:i:s'); | ||
| 599 | + $data[] = $v; | ||
| 600 | + } | ||
| 601 | + return $detailModel->insert($data); | ||
| 602 | + } | ||
| 603 | + } | ||
| 604 | + /** | ||
| 580 | * @remark :复制项目扩展字段 | 605 | * @remark :复制项目扩展字段 |
| 581 | * @name :copyExtendInfo | 606 | * @name :copyExtendInfo |
| 582 | * @author :lyh | 607 | * @author :lyh |
-
请 注册 或 登录 后发表评论