|
...
|
...
|
@@ -75,6 +75,9 @@ class ProjectLogic extends BaseLogic |
|
|
|
if(empty($info['channel'])){
|
|
|
|
$info['channel'] = ["user_id"=>"", "zone_id"=>"", "channel_id"=>""];
|
|
|
|
}
|
|
|
|
if(empty($info['payment']['renewal_record'])){
|
|
|
|
$info['payment']['renewal_record'] = [["amount"=> null, "remark"=> null, "expire_at"=> null]];
|
|
|
|
}
|
|
|
|
return $this->success($info);
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -533,9 +536,12 @@ class ProjectLogic extends BaseLogic |
|
|
|
* @time :2023/11/8 14:23
|
|
|
|
*/
|
|
|
|
public function copyProject(){
|
|
|
|
DB::beginTransaction();
|
|
|
|
try {
|
|
|
|
//复制初始项目
|
|
|
|
$data = $this->model::where('id', $this->param['project_id'])->first();
|
|
|
|
$data = $data->getAttributes();
|
|
|
|
$type = $data['type'];
|
|
|
|
$data['type'] = 0;
|
|
|
|
$data['title'] = $data['title'].'-copy';
|
|
|
|
unset($data['id']);
|
|
...
|
...
|
@@ -597,7 +603,14 @@ class ProjectLogic extends BaseLogic |
|
|
|
$settingData['project_id'] = $project_id;
|
|
|
|
$settingTemplateModel->insert($settingData);
|
|
|
|
}
|
|
|
|
DB::commit();
|
|
|
|
}catch (\Exception $e){
|
|
|
|
DB::rollBack();
|
|
|
|
$this->fail('error');
|
|
|
|
}
|
|
|
|
if($type != 0){
|
|
|
|
$this->copyMysql($this->param['project_id'],$project_id);
|
|
|
|
}
|
|
|
|
return $this->success($data);
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|