作者 lyh

gx

@@ -522,8 +522,20 @@ class ProjectLogic extends BaseLogic @@ -522,8 +522,20 @@ class ProjectLogic extends BaseLogic
522 * @time :2023/11/8 14:23 522 * @time :2023/11/8 14:23
523 */ 523 */
524 public function copyProject(){ 524 public function copyProject(){
  525 + //复制初始项目
525 $data = $this->model::where('id', $this->param['project_id'])->first(); 526 $data = $this->model::where('id', $this->param['project_id'])->first();
526 $data = $data->getAttributes(); 527 $data = $data->getAttributes();
  528 + unset($data['id']);
  529 + $project_id = $this->model->insertGetId($data);
  530 + //复制部署表
  531 + $buildModel = new DeployBuild();
  532 + $buildData = $buildModel::where('id', $this->param['project_id'])->first();
  533 + $buildData = $buildData->getAttributes();
  534 + $buildData['project_id'] = $project_id;
  535 + unset($buildData['id']);
  536 + $buildModel->insert($buildData);
  537 + //复制优化表
  538 + $optimizeModel = new DeployOptimize();
527 return $this->success($data); 539 return $this->success($data);
528 } 540 }
529 } 541 }