作者 张关杰

Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into bate

@@ -307,13 +307,11 @@ class DomainInfoLogic extends BaseLogic @@ -307,13 +307,11 @@ class DomainInfoLogic extends BaseLogic
307 //主站生成证书 307 //主站生成证书
308 EditDomainBt::dispatch($this->param['id']); 308 EditDomainBt::dispatch($this->param['id']);
309 // $this->setDomainSsl($server_info['init_domain'],$info['domain'],$this->param['extend_config'] ?? [],$this->param['other_domain'] ?? [],$this->param['is_https'] ?? 0); 309 // $this->setDomainSsl($server_info['init_domain'],$info['domain'],$this->param['extend_config'] ?? [],$this->param['other_domain'] ?? [],$this->param['is_https'] ?? 0);
310 -  
311 //amp站生成证书 310 //amp站生成证书
312 if($data['amp_status']){ 311 if($data['amp_status']){
313 EditAmpDomainBt::dispatch($this->param['id']); 312 EditAmpDomainBt::dispatch($this->param['id']);
314 // $this->setAmpDomainSsl($server_info['init_domain'],$info['domain']); 313 // $this->setAmpDomainSsl($server_info['init_domain'],$info['domain']);
315 } 314 }
316 -  
317 return $this->success(); 315 return $this->success();
318 } 316 }
319 317
@@ -77,9 +77,8 @@ class RankDataLogic extends BaseLogic @@ -77,9 +77,8 @@ class RankDataLogic extends BaseLogic
77 'keyword_num' => $project['deploy_build']['keyword_num'], 77 'keyword_num' => $project['deploy_build']['keyword_num'],
78 'compliance_day' => $project['finish_remain_day'] ?? 0, 78 'compliance_day' => $project['finish_remain_day'] ?? 0,
79 'remain_day' => $project['deploy_build']['service_duration'] - ($project['finish_remain_day'] ?? 0), 79 'remain_day' => $project['deploy_build']['service_duration'] - ($project['finish_remain_day'] ?? 0),
80 - 'g_top_plan' => $project['g_top_plan'] ?? [], 80 + 'g_top_plan' => $project['deploy_optimize']['g_top_plan'] ?? [],
81 ]; 81 ];
82 -  
83 //小语种列表 82 //小语种列表
84 $quanqiusou_api = new QuanqiusouApi(); 83 $quanqiusou_api = new QuanqiusouApi();
85 $lang_data = $quanqiusou_api->getLangRankData($api_no); 84 $lang_data = $quanqiusou_api->getLangRankData($api_no);
@@ -38,7 +38,6 @@ class EditCustomDomainBt implements ShouldQueue @@ -38,7 +38,6 @@ class EditCustomDomainBt implements ShouldQueue
38 */ 38 */
39 public function handle() 39 public function handle()
40 { 40 {
41 - @file_put_contents(storage_path('logs/lyh_error.log'), var_export('生成证书---开始', true) . PHP_EOL, FILE_APPEND);  
42 //获取域名数据 41 //获取域名数据
43 $domain_model = new CountryCustom(); 42 $domain_model = new CountryCustom();
44 $domain_info = $domain_model->read(['id' => $this->domain_id]); 43 $domain_info = $domain_model->read(['id' => $this->domain_id]);
@@ -68,7 +67,6 @@ class EditCustomDomainBt implements ShouldQueue @@ -68,7 +67,6 @@ class EditCustomDomainBt implements ShouldQueue
68 'other_domain' => [], 67 'other_domain' => [],
69 'is_https' => 1 68 'is_https' => 1
70 ]; 69 ];
71 - @file_put_contents(storage_path('logs/lyh_error.log'), var_export('生成证书--参数:'.json_encode($api_param), true) . PHP_EOL, FILE_APPEND);  
72 } else { 70 } else {
73 $api_url = 'http://' . $server_info['init_domain'] . '/api/applySsl'; 71 $api_url = 'http://' . $server_info['init_domain'] . '/api/applySsl';
74 $api_param = [ 72 $api_param = [
@@ -77,11 +75,9 @@ class EditCustomDomainBt implements ShouldQueue @@ -77,11 +75,9 @@ class EditCustomDomainBt implements ShouldQueue
77 'other_domain' => [], 75 'other_domain' => [],
78 'is_https' => 1 76 'is_https' => 1
79 ]; 77 ];
80 - @file_put_contents(storage_path('logs/lyh_error.log'), var_export('生成证书--参数:'.json_encode($api_param), true) . PHP_EOL, FILE_APPEND);  
81 } 78 }
82 try { 79 try {
83 $rs = HttpUtils::get($api_url, $api_param); 80 $rs = HttpUtils::get($api_url, $api_param);
84 - @file_put_contents(storage_path('logs/lyh_error.log'), var_export('请求接口返回数据:'.$rs, true) . PHP_EOL, FILE_APPEND);  
85 $rs = json_decode($rs, true); 81 $rs = json_decode($rs, true);
86 if (isset($rs['status']) && $rs['status'] == 200) { 82 if (isset($rs['status']) && $rs['status'] == 200) {
87 $this->output($domain_info['custom_domain'] . ':站点编辑成功'); 83 $this->output($domain_info['custom_domain'] . ':站点编辑成功');
@@ -89,7 +85,6 @@ class EditCustomDomainBt implements ShouldQueue @@ -89,7 +85,6 @@ class EditCustomDomainBt implements ShouldQueue
89 $this->output($domain_info['custom_domain'] . ':站点编辑失败,原因:' . ($rs['message'] ?? '')); 85 $this->output($domain_info['custom_domain'] . ':站点编辑失败,原因:' . ($rs['message'] ?? ''));
90 } 86 }
91 } catch (\Exception | GuzzleException $e) { 87 } catch (\Exception | GuzzleException $e) {
92 - @file_put_contents(storage_path('logs/lyh_error.log'), var_export('错误情况打印:'.$rs, true) . PHP_EOL, FILE_APPEND);  
93 $this->output($domain_info['custom_domain'] . ':站点编辑失败,原因:' . $e->getMessage()); 88 $this->output($domain_info['custom_domain'] . ':站点编辑失败,原因:' . $e->getMessage());
94 } 89 }
95 90
@@ -9,6 +9,7 @@ use App\Models\Devops\ServerConfig; @@ -9,6 +9,7 @@ use App\Models\Devops\ServerConfig;
9 use App\Models\Optimize\Process; 9 use App\Models\Optimize\Process;
10 use App\Services\Facades\Upload; 10 use App\Services\Facades\Upload;
11 use Illuminate\Support\Facades\Cache; 11 use Illuminate\Support\Facades\Cache;
  12 +use App\Models\Domain\DomainInfo as DomainInfoModel;
12 13
13 class Project extends Base 14 class Project extends Base
14 { 15 {
@@ -354,19 +355,23 @@ class Project extends Base @@ -354,19 +355,23 @@ class Project extends Base
354 $project_id = DeployBuild::where('test_domain', 'https://' . $domain . '/')->value('project_id'); 355 $project_id = DeployBuild::where('test_domain', 'https://' . $domain . '/')->value('project_id');
355 //是否正式域名 356 //是否正式域名
356 if (!$project_id) { 357 if (!$project_id) {
357 - //是否小语种域名或amp站域名  
358 - $domainPrefix = explode(".",$domain);  
359 - if (!empty($domainPrefix)){  
360 - if($domainPrefix[0] == 'm'){  
361 - $domain = "www.".$domainPrefix[1].".".$domainPrefix[2];  
362 - }else{  
363 - $isLang = Translate::getTls($domainPrefix[0]);  
364 - if ($isLang) { 358 + $domainModel = new DomainInfoModel();
  359 + $project_id = $domainModel->formatQuery(['domain'=>$domain,'status'=>1])->value('project_id');
  360 + if (empty($project_id)) {
  361 + //是否小语种域名或amp站域名
  362 + $domainPrefix = explode(".",$domain);
  363 + if (!empty($domainPrefix)){
  364 + if($domainPrefix[0] == 'm'){
365 $domain = "www.".$domainPrefix[1].".".$domainPrefix[2]; 365 $domain = "www.".$domainPrefix[1].".".$domainPrefix[2];
  366 + }else{
  367 + $isLang = Translate::getTls($domainPrefix[0]);
  368 + if ($isLang) {
  369 + $domain = "www.".$domainPrefix[1].".".$domainPrefix[2];
  370 + }
366 } 371 }
367 } 372 }
  373 + $project_id = $domainModel->formatQuery(['domain'=>$domain,'status'=>1])->value('project_id');
368 } 374 }
369 - $project_id = \App\Models\Domain\DomainInfo::where('domain', $domain)->value('project_id');  
370 } 375 }
371 $project = self::find($project_id ?: 0); 376 $project = self::find($project_id ?: 0);
372 if($project){ 377 if($project){