正在显示
1 个修改的文件
包含
12 行增加
和
1 行删除
| @@ -533,6 +533,8 @@ class ProductLogic extends BaseLogic | @@ -533,6 +533,8 @@ class ProductLogic extends BaseLogic | ||
| 533 | $this->copyTemplate($this->param['id'],$info['project_id'],$save_id); | 533 | $this->copyTemplate($this->param['id'],$info['project_id'],$save_id); |
| 534 | //同步扩展字段 | 534 | //同步扩展字段 |
| 535 | $this->copyExtendInfo($info['id'],$save_id); | 535 | $this->copyExtendInfo($info['id'],$save_id); |
| 536 | + $this->copyColumn($info['id'],$save_id); | ||
| 537 | + $this->copyDetail($info['id'],$save_id); | ||
| 536 | DB::commit(); | 538 | DB::commit(); |
| 537 | }catch (\Exception $e){ | 539 | }catch (\Exception $e){ |
| 538 | DB::rollBack(); | 540 | DB::rollBack(); |
| @@ -542,7 +544,7 @@ class ProductLogic extends BaseLogic | @@ -542,7 +544,7 @@ class ProductLogic extends BaseLogic | ||
| 542 | } | 544 | } |
| 543 | 545 | ||
| 544 | /** | 546 | /** |
| 545 | - * @remark :复制描述 | 547 | + * @remark :复制栏目 |
| 546 | * @name :copyDetail | 548 | * @name :copyDetail |
| 547 | * @author :lyh | 549 | * @author :lyh |
| 548 | * @method :post | 550 | * @method :post |
| @@ -564,6 +566,13 @@ class ProductLogic extends BaseLogic | @@ -564,6 +566,13 @@ class ProductLogic extends BaseLogic | ||
| 564 | } | 566 | } |
| 565 | } | 567 | } |
| 566 | 568 | ||
| 569 | + /** | ||
| 570 | + * @remark :复制描述 | ||
| 571 | + * @name :copyDetail | ||
| 572 | + * @author :lyh | ||
| 573 | + * @method :post | ||
| 574 | + * @time :2024/12/18 16:02 | ||
| 575 | + */ | ||
| 567 | public function copyDetail($product_id,$new_product_id){ | 576 | public function copyDetail($product_id,$new_product_id){ |
| 568 | $detailModel = new Detail(); | 577 | $detailModel = new Detail(); |
| 569 | $detailList = $detailModel->list(['product_id'=>$product_id]); | 578 | $detailList = $detailModel->list(['product_id'=>$product_id]); |
| @@ -571,6 +580,8 @@ class ProductLogic extends BaseLogic | @@ -571,6 +580,8 @@ class ProductLogic extends BaseLogic | ||
| 571 | $data = []; | 580 | $data = []; |
| 572 | foreach ($detailList as $k => $v){ | 581 | foreach ($detailList as $k => $v){ |
| 573 | unset($v['id']); | 582 | unset($v['id']); |
| 583 | + $v['css'] = Arr::a2s($v['css']); | ||
| 584 | + $v['content'] = Arr::a2s($v['content']); | ||
| 574 | $v['product_id'] = $new_product_id; | 585 | $v['product_id'] = $new_product_id; |
| 575 | $v['created_at'] = date('Y-m-d H:i:s'); | 586 | $v['created_at'] = date('Y-m-d H:i:s'); |
| 576 | $v['updated_at'] = date('Y-m-d H:i:s'); | 587 | $v['updated_at'] = date('Y-m-d H:i:s'); |
-
请 注册 或 登录 后发表评论