|
...
|
...
|
@@ -162,9 +162,6 @@ class DomainInfoLogic extends BaseLogic |
|
|
|
if($project_info['type'] == Project::TYPE_CLOSE){
|
|
|
|
$this->fail('项目已关闭,无法执行此操作');
|
|
|
|
}
|
|
|
|
if($project_info['project_type'] == Project::PROJECT_TYPE_SEO){
|
|
|
|
$this->fail('白帽SEO项目,无法执行此操作');
|
|
|
|
}
|
|
|
|
$serverIpModel = new ServersIp();
|
|
|
|
$serversIpInfo = $serverIpModel->read(['id'=>$project_info['serve_id']],['servers_id','ip','domain']);
|
|
|
|
if($serversIpInfo === false){
|
|
...
|
...
|
@@ -230,7 +227,13 @@ class DomainInfoLogic extends BaseLogic |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(isset($this->param['amp_status']) && $this->param['amp_status'] == 1){
|
|
|
|
//是否开通m站
|
|
|
|
$amp_status = $this->param['amp_status'] ?? 0;
|
|
|
|
if($project_info['project_type'] == Project::PROJECT_TYPE_SEO){
|
|
|
|
$amp_status = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if($amp_status){
|
|
|
|
//需要开通amp站点,判断m域名是否已经解析
|
|
|
|
$host_array_amp = $host_array;
|
|
|
|
if (count($host_array_amp) <= 2) {
|
|
...
|
...
|
@@ -322,7 +325,7 @@ class DomainInfoLogic extends BaseLogic |
|
|
|
'private_key' => $this->param['key'] ?? '',
|
|
|
|
'private_cert' => $this->param['cert'] ?? '',
|
|
|
|
'is_https' => $is_https,
|
|
|
|
'amp_status' => $this->param['amp_status'] ?? 0,
|
|
|
|
'amp_status' => $amp_status,
|
|
|
|
'amp_type' => $this->param['amp_type'] ?? 0,
|
|
|
|
'amp_extend_config'=>json_encode($amp_extend_config),
|
|
|
|
'amp_private_key' => $this->param['amp_key'] ?? '',
|
|
...
|
...
|
@@ -334,21 +337,26 @@ class DomainInfoLogic extends BaseLogic |
|
|
|
$this->model->edit($data,['id'=>$this->param['id']]);
|
|
|
|
|
|
|
|
//新增建站任务
|
|
|
|
if ($project_info['project_type'] == Project::PROJECT_TYPE_SEO) {
|
|
|
|
$type = DomainCreateTask::TYPE_BLOG;
|
|
|
|
} else {
|
|
|
|
$type = DomainCreateTask::TYPE_MAIN;
|
|
|
|
}
|
|
|
|
$task_model = new DomainCreateTask();
|
|
|
|
$task_info = $task_model->read(['type'=>DomainCreateTask::TYPE_MAIN,'domain_id'=>$this->param['id'],'status'=>['<',DomainCreateTask::STATUS_SUC]]);
|
|
|
|
$task_info = $task_model->read(['type'=>$type,'domain_id'=>$this->param['id'],'status'=>['<',DomainCreateTask::STATUS_SUC]]);
|
|
|
|
if(!$task_info){
|
|
|
|
$task_model->add([
|
|
|
|
'server_id' => $serversIpInfo['servers_id'],
|
|
|
|
'project_id' => $info['project_id'],
|
|
|
|
'domain_id' => $this->param['id'],
|
|
|
|
'type' => DomainCreateTask::TYPE_MAIN
|
|
|
|
'type' => $type
|
|
|
|
]);
|
|
|
|
}else{
|
|
|
|
if($task_info['status'] == DomainCreateTask::STATUS_UN){
|
|
|
|
$task_model->edit(['sort'=>0],['id'=>$task_info['id']]);
|
|
|
|
$task_model->edit(['sort'=>1],['id'=>$task_info['id']]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if($data['amp_status']){
|
|
|
|
if($amp_status){
|
|
|
|
$task_amp_info = $task_model->read(['type'=>DomainCreateTask::TYPE_AMP,'domain_id'=>$this->param['id'],'status'=>['<',DomainCreateTask::STATUS_SUC]]);
|
|
|
|
if(!$task_amp_info){
|
|
|
|
$task_model->add([
|
...
|
...
|
|