正在显示
1 个修改的文件
包含
17 行增加
和
9 行删除
| @@ -162,9 +162,6 @@ class DomainInfoLogic extends BaseLogic | @@ -162,9 +162,6 @@ class DomainInfoLogic extends BaseLogic | ||
| 162 | if($project_info['type'] == Project::TYPE_CLOSE){ | 162 | if($project_info['type'] == Project::TYPE_CLOSE){ |
| 163 | $this->fail('项目已关闭,无法执行此操作'); | 163 | $this->fail('项目已关闭,无法执行此操作'); |
| 164 | } | 164 | } |
| 165 | - if($project_info['project_type'] == Project::PROJECT_TYPE_SEO){ | ||
| 166 | - $this->fail('白帽SEO项目,无法执行此操作'); | ||
| 167 | - } | ||
| 168 | $serverIpModel = new ServersIp(); | 165 | $serverIpModel = new ServersIp(); |
| 169 | $serversIpInfo = $serverIpModel->read(['id'=>$project_info['serve_id']],['servers_id','ip','domain']); | 166 | $serversIpInfo = $serverIpModel->read(['id'=>$project_info['serve_id']],['servers_id','ip','domain']); |
| 170 | if($serversIpInfo === false){ | 167 | if($serversIpInfo === false){ |
| @@ -230,7 +227,13 @@ class DomainInfoLogic extends BaseLogic | @@ -230,7 +227,13 @@ class DomainInfoLogic extends BaseLogic | ||
| 230 | } | 227 | } |
| 231 | } | 228 | } |
| 232 | 229 | ||
| 233 | - if(isset($this->param['amp_status']) && $this->param['amp_status'] == 1){ | 230 | + //是否开通m站 |
| 231 | + $amp_status = $this->param['amp_status'] ?? 0; | ||
| 232 | + if($project_info['project_type'] == Project::PROJECT_TYPE_SEO){ | ||
| 233 | + $amp_status = 0; | ||
| 234 | + } | ||
| 235 | + | ||
| 236 | + if($amp_status){ | ||
| 234 | //需要开通amp站点,判断m域名是否已经解析 | 237 | //需要开通amp站点,判断m域名是否已经解析 |
| 235 | $host_array_amp = $host_array; | 238 | $host_array_amp = $host_array; |
| 236 | if (count($host_array_amp) <= 2) { | 239 | if (count($host_array_amp) <= 2) { |
| @@ -322,7 +325,7 @@ class DomainInfoLogic extends BaseLogic | @@ -322,7 +325,7 @@ class DomainInfoLogic extends BaseLogic | ||
| 322 | 'private_key' => $this->param['key'] ?? '', | 325 | 'private_key' => $this->param['key'] ?? '', |
| 323 | 'private_cert' => $this->param['cert'] ?? '', | 326 | 'private_cert' => $this->param['cert'] ?? '', |
| 324 | 'is_https' => $is_https, | 327 | 'is_https' => $is_https, |
| 325 | - 'amp_status' => $this->param['amp_status'] ?? 0, | 328 | + 'amp_status' => $amp_status, |
| 326 | 'amp_type' => $this->param['amp_type'] ?? 0, | 329 | 'amp_type' => $this->param['amp_type'] ?? 0, |
| 327 | 'amp_extend_config'=>json_encode($amp_extend_config), | 330 | 'amp_extend_config'=>json_encode($amp_extend_config), |
| 328 | 'amp_private_key' => $this->param['amp_key'] ?? '', | 331 | 'amp_private_key' => $this->param['amp_key'] ?? '', |
| @@ -334,21 +337,26 @@ class DomainInfoLogic extends BaseLogic | @@ -334,21 +337,26 @@ class DomainInfoLogic extends BaseLogic | ||
| 334 | $this->model->edit($data,['id'=>$this->param['id']]); | 337 | $this->model->edit($data,['id'=>$this->param['id']]); |
| 335 | 338 | ||
| 336 | //新增建站任务 | 339 | //新增建站任务 |
| 340 | + if ($project_info['project_type'] == Project::PROJECT_TYPE_SEO) { | ||
| 341 | + $type = DomainCreateTask::TYPE_BLOG; | ||
| 342 | + } else { | ||
| 343 | + $type = DomainCreateTask::TYPE_MAIN; | ||
| 344 | + } | ||
| 337 | $task_model = new DomainCreateTask(); | 345 | $task_model = new DomainCreateTask(); |
| 338 | - $task_info = $task_model->read(['type'=>DomainCreateTask::TYPE_MAIN,'domain_id'=>$this->param['id'],'status'=>['<',DomainCreateTask::STATUS_SUC]]); | 346 | + $task_info = $task_model->read(['type'=>$type,'domain_id'=>$this->param['id'],'status'=>['<',DomainCreateTask::STATUS_SUC]]); |
| 339 | if(!$task_info){ | 347 | if(!$task_info){ |
| 340 | $task_model->add([ | 348 | $task_model->add([ |
| 341 | 'server_id' => $serversIpInfo['servers_id'], | 349 | 'server_id' => $serversIpInfo['servers_id'], |
| 342 | 'project_id' => $info['project_id'], | 350 | 'project_id' => $info['project_id'], |
| 343 | 'domain_id' => $this->param['id'], | 351 | 'domain_id' => $this->param['id'], |
| 344 | - 'type' => DomainCreateTask::TYPE_MAIN | 352 | + 'type' => $type |
| 345 | ]); | 353 | ]); |
| 346 | }else{ | 354 | }else{ |
| 347 | if($task_info['status'] == DomainCreateTask::STATUS_UN){ | 355 | if($task_info['status'] == DomainCreateTask::STATUS_UN){ |
| 348 | - $task_model->edit(['sort'=>0],['id'=>$task_info['id']]); | 356 | + $task_model->edit(['sort'=>1],['id'=>$task_info['id']]); |
| 349 | } | 357 | } |
| 350 | } | 358 | } |
| 351 | - if($data['amp_status']){ | 359 | + if($amp_status){ |
| 352 | $task_amp_info = $task_model->read(['type'=>DomainCreateTask::TYPE_AMP,'domain_id'=>$this->param['id'],'status'=>['<',DomainCreateTask::STATUS_SUC]]); | 360 | $task_amp_info = $task_model->read(['type'=>DomainCreateTask::TYPE_AMP,'domain_id'=>$this->param['id'],'status'=>['<',DomainCreateTask::STATUS_SUC]]); |
| 353 | if(!$task_amp_info){ | 361 | if(!$task_amp_info){ |
| 354 | $task_model->add([ | 362 | $task_model->add([ |
-
请 注册 或 登录 后发表评论