|
...
|
...
|
@@ -64,6 +64,15 @@ class CopyProjectJob implements ShouldQueue |
|
|
|
$project_id = $projectModel->insertGetId($data);
|
|
|
|
$hashids = new Hashids($data['from_order_id'], 13, 'abcdefghjkmnpqrstuvwxyz1234567890');
|
|
|
|
$projectModel->edit(['from_order_id'=>$hashids->encode($project_id)],['id'=>$project_id]);
|
|
|
|
//复制设置的模版
|
|
|
|
$settingTemplateModel = new Setting();
|
|
|
|
$settingData = $settingTemplateModel::where('project_id', $this->param['project_id'])->first();
|
|
|
|
if(!empty($settingData)){
|
|
|
|
$settingData = $settingData->getAttributes();
|
|
|
|
unset($settingData['id']);
|
|
|
|
$settingData['project_id'] = $project_id;
|
|
|
|
$settingTemplateModel->insert($settingData);
|
|
|
|
}
|
|
|
|
//复制部署表
|
|
|
|
$buildModel = new DeployBuild();
|
|
|
|
$buildData = $buildModel::where('project_id', $this->param['project_id'])->first();
|
|
...
|
...
|
@@ -114,15 +123,6 @@ class CopyProjectJob implements ShouldQueue |
|
|
|
$userData['project_id'] = $project_id;
|
|
|
|
$userModel->insert($userData);
|
|
|
|
}
|
|
|
|
//复制设置的模版
|
|
|
|
$settingTemplateModel = new Setting();
|
|
|
|
$settingData = $settingTemplateModel::where('project_id', $this->param['project_id'])->first();
|
|
|
|
if(!empty($settingData)){
|
|
|
|
$settingData = $settingData->getAttributes();
|
|
|
|
unset($settingData['id']);
|
|
|
|
$settingData['project_id'] = $project_id;
|
|
|
|
$settingTemplateModel->insert($settingData);
|
|
|
|
}
|
|
|
|
DB::commit();
|
|
|
|
}catch (\Exception $e){
|
|
|
|
DB::rollBack();
|
...
|
...
|
|