作者 刘锟

update

... ... @@ -3,6 +3,7 @@
namespace App\Console\Commands\Test;
use App\Helper\Arr;
use App\Jobs\UpdatePageJob;
use App\Models\Com\Notify;
use App\Models\Devops\ServerConfig;
use App\Models\Devops\ServersIp;
... ... @@ -38,7 +39,7 @@ class Temp extends Command
* @author Akun
* @date 2024/12/10 10:43
*/
public function handle()
public function handle6()
{
//获取所有组内推广项目
$leader_mid = 16;
... ... @@ -49,27 +50,35 @@ class Temp extends Command
foreach ($project_list as $project) {
$project_id = $project->id;
$this->output('项目id:' . $project_id . ',start');
//获取项目域名情况
$domain_info = DomainInfo::where('project_id', $project_id)->where('status', 1)->first();
if (!$domain_info) {
$this->output('未绑定正式域名');
$this->output('项目id:' . $project_id . ' | 未绑定正式域名');
continue;
}
$domain_id = $domain_info->id;
$domain = $domain_info->domain;
//获取项目所在服务器
$serve_ip_info = ServersIp::where('id', $project->serve_id)->first();
$serve_ip_info = ServersIp::select(['id', 'ip', 'domain', 'servers_id'])->where('id', $project->serve_id)->first()->toArray();
if (!$serve_ip_info) {
$this->output('未查询到服务器数据');
$this->output('项目id:' . $project_id . ' | 未查询到服务器数据');
continue;
}
$servers_id = $serve_ip_info->servers_id;
$servers_id = $serve_ip_info['servers_id'];
if ($servers_id == ServerConfig::SELF_SITE_ID) {
$this->output('自建站项目过滤');
$this->output('项目id:' . $project_id . ' | 自建站项目过滤');
continue;
}
if ($servers_id == ServerConfig::SELF_TEST_ID) {
$this->output('项目id:' . $project_id . ' | 测试项目过滤');
continue;
}
if (!check_domain_record($domain_info['domain'], $serve_ip_info)) {
$this->output('项目id:' . $project_id . ', domain:' . $domain . ' | 未解析到目标服务器');
continue;
}
... ... @@ -99,7 +108,7 @@ class Temp extends Command
]);
//请求对应C端页面更新接口
$c_url = $domain . '/api/update_page/';
$c_url = 'https://' . $domain . '/api/update_page/';
$c_params = [
'project_id' => $project_id,
'type' => 3
... ... @@ -110,8 +119,6 @@ class Temp extends Command
} else {
$this->output($c_url . ' | ' . ($re['message'] ?? '未返回失败原因'));
}
$this->output('项目id:' . $project_id . ',end');
}
}
... ... @@ -375,7 +382,7 @@ class Temp extends Command
}
} else {
//其他服务器:请求对应C端接口
$c_url = $domain . '/api/update_page/';
$c_url = 'https://' . $domain . '/api/update_page/';
$c_params = [
'project_id' => $project_id,
'type' => 3
... ...