作者 lyh

gx脚本更新路由

... ... @@ -533,6 +533,8 @@ class ProductLogic extends BaseLogic
$this->copyTemplate($this->param['id'],$info['project_id'],$save_id);
//同步扩展字段
$this->copyExtendInfo($info['id'],$save_id);
$this->copyColumn($info['id'],$save_id);
$this->copyDetail($info['id'],$save_id);
DB::commit();
}catch (\Exception $e){
DB::rollBack();
... ... @@ -542,7 +544,7 @@ class ProductLogic extends BaseLogic
}
/**
* @remark :复制描述
* @remark :复制栏目
* @name :copyDetail
* @author :lyh
* @method :post
... ... @@ -564,6 +566,13 @@ class ProductLogic extends BaseLogic
}
}
/**
* @remark :复制描述
* @name :copyDetail
* @author :lyh
* @method :post
* @time :2024/12/18 16:02
*/
public function copyDetail($product_id,$new_product_id){
$detailModel = new Detail();
$detailList = $detailModel->list(['product_id'=>$product_id]);
... ... @@ -571,6 +580,8 @@ class ProductLogic extends BaseLogic
$data = [];
foreach ($detailList as $k => $v){
unset($v['id']);
$v['css'] = Arr::a2s($v['css']);
$v['content'] = Arr::a2s($v['content']);
$v['product_id'] = $new_product_id;
$v['created_at'] = date('Y-m-d H:i:s');
$v['updated_at'] = date('Y-m-d H:i:s');
... ...