作者 赵彬吉
... ... @@ -68,7 +68,7 @@ class CopyProject extends Command
$item->status = NoticeLog::STATUS_FAIL;
$item->save();
}
sleep(180);
sleep(60);
try {
$this->copyMysql($old_project_id,$project_id);
}catch (\Exception $e){
... ...
... ... @@ -87,7 +87,7 @@ class DomainInfoLogic extends BaseLogic
//查看当前域名是否有项目在使用
if($this->param['status'] != $this->model::STATUS_ONE){
$info = $this->model->read(['id'=>$this->param['id']]);
if($info === false){
if($info['project_id'] != 0){
$this->fail('当前域名有项目正在使用中');
}
}
... ...
... ... @@ -533,7 +533,7 @@ class ProjectLogic extends BaseLogic
//单独保存行业信息
ProjectIndustryRelated::saveRelated($deploy_optimize['project_id'],$deploy_optimize['industry'] ?? []);
$deployOptimizeModel = new DeployOptimize();
if(isset($deploy_optimize['domain']) && !empty($deploy_optimize['domain'])){
if(isset($deploy_optimize['domain'])){
//更改域名
$this->editDomainStatus($deploy_optimize['domain'],$deploy_optimize['project_id']);
}
... ... @@ -915,15 +915,11 @@ class ProjectLogic extends BaseLogic
}
$domainModel = new DomainInfo();
//查看当前域名是否已使用
$domainInfo = $domainModel->read(['id'=>$domain,'project_id'=>['!=',0]]);
$domainInfo = $domainModel->read(['id'=>$domain,'status'=>1,'project_id'=>['!=',0]]);
if($domainInfo !== false){
$this->fail('当前域名已被其他服务器使用');
}
//先清空上一次所绑定的域名
$info = $domainModel->read(['project_id'=>$project_id]);
if($info !== false){
$domainModel->edit(['project_id'=>0,'status'=>DomainInfo::STATUS_ZERO],['id'=>$info['id']]);
}
$domainModel->edit(['project_id'=>0,'status'=>DomainInfo::STATUS_ZERO],['project_id'=>$project_id]);
//重新设置域名
$domainModel->edit(['status'=>DomainInfo::STATUS_ONE,'project_id'=>$project_id],['id'=>$domain]);
return $this->success();
... ... @@ -959,15 +955,15 @@ class ProjectLogic extends BaseLogic
$noticeModel = new NoticeLog();
$info = $noticeModel->read(['type'=>NoticeLog::TYPE_COPY_PROJECT,'status'=>0,'data'=>['like','%"'.$this->param['project_id'].'"%']]);
if($info !== false){
return $this->success('当前项目已在复制中');
return $this->success(['message'=>'当前项目已在复制中']);
}
$projectModel = new Project();
$projectInfo = $projectModel->read(['old_project_id'=>$this->param['project_id']]);
$projectInfo = $projectModel->read(['type'=>0,'old_project_id'=>$this->param['project_id']]);
if($projectInfo !== false){
return $this->success('当前项目已复制过');
return $this->success(['message'=>'当前项目已复制过']);
}
NoticeLog::createLog(NoticeLog::TYPE_COPY_PROJECT, ['project_id' => $this->param['project_id']]);
return $this->success('项目复制中,请稍后前往初始化项目查看;');
return $this->success(['message'=>'项目复制中,请稍后前往初始化项目查看;']);
}
/**
... ...