作者 lyh
... ... @@ -380,7 +380,7 @@ class UpdateSeoTdk extends Command
$projectKeywordModel = new ProjectKeyword();
$keywordInfo = $projectKeywordModel->read(['project_id'=>$project_id]);
$info['main_keyword'] = '';
if($keywordInfo === false){
if(!empty($keywordInfo['main_keyword'])){
$info['main_keyword'] = $keywordInfo['main_keyword'];
}
Cache::put($cache_key, $info, 600);
... ...
... ... @@ -29,22 +29,22 @@ class Temp extends Command
public function handle()
{
$notify_model = new Notify();
$project_model = new Project();
$serve_ip_model = new ServersIp();
$domain_list = DomainInfo::where('status', 1)->where('amp_status', 1)->get();
foreach ($domain_list as $domain) {
$project_id = $domain->project_id;
$domain = $domain->domain;
foreach ($domain_list as $domain_info) {
$project_id = $domain_info->project_id;
$domain = $domain_info->domain;
$this->output('项目id:' . $project_id . ',start');
//获取项目所在服务器
$project_model = new Project();
$project_info = $project_model->read(['id' => $project_id], ['serve_id']);
if (!$project_info) {
$this->output('未查询到项目数据');
}
$serve_ip_model = new ServersIp();
$serve_ip_info = $serve_ip_model->read(['id' => $project_info['serve_id']], ['servers_id']);
if (!$serve_ip_info) {
$this->output('未查询到服务器数据');
... ... @@ -80,15 +80,9 @@ class Temp extends Command
}
} else {
//其他服务器:请求对应C端接口
$c_url = $domain . '/api/update_page/';
$param = [
'project_id' => $project_id,
'type' => 3,
'route' => 1,
'url' => [],
'language' => []
];
http_post($c_url, json_encode($param));
$c_url = $domain . '/api/update_page/?project_id=' . $project_id . '&type=3';
$re = http_get($c_url);
$this->output($re['message'] ?? '');
}
$this->output('项目id:' . $project_id . ',end');
}
... ...