修改CF优选IP添加解析

This commit is contained in:
net909 2025-02-05 11:17:26 +08:00
parent 8980910d47
commit 48d5ad7569
2 changed files with 6 additions and 5 deletions

View File

@ -146,17 +146,19 @@ class OptimizeService
if (empty($iplist)) {
continue;
}
$record_num = $row['recordnum'];
$get_ips = array_column($iplist, 'ip');
if ($drow['type'] == 'huawei') {
sort($get_ips);
$get_ips = array_slice($get_ips, 0, $row['recordnum']);
$get_ips = [implode(',', $get_ips)];
$row['recordnum'] = 1;
$record_num = 1;
}
if ($row['type'] == 1 && $line == 'CT') {
$line = 'DEF';
}
$line_name = DnsHelper::$line_name[$drow['type']][$line];
$this->process_dns_line($dns, $row, $domainRecords['list'], $get_ips, $line_name, $ip_type);
$this->process_dns_line($dns, $row, $domainRecords['list'], $record_num, $get_ips, $line_name, $ip_type);
}
}
@ -164,9 +166,8 @@ class OptimizeService
}
//处理单个线路的解析记录
private function process_dns_line($dns, $row, $record_list, $get_ips, $line_name, $ip_type)
private function process_dns_line($dns, $row, $record_list, $record_num, $get_ips, $line_name, $ip_type)
{
$record_num = $row['recordnum'];
$records = array_filter($record_list, function ($v) use ($line_name) {
return $v['Line'] == $line_name;
});

View File

@ -31,7 +31,7 @@ return [
'show_error_msg' => true,
'exception_tmpl' => \think\facade\App::getAppPath() . 'view/exception.tpl',
'version' => '1028',
'version' => '1029',
'dbversion' => '1023'
];