mirror of
https://github.com/netcccyun/dnsmgr.git
synced 2026-02-21 15:31:12 +08:00
修改CF优选IP添加解析
This commit is contained in:
parent
8980910d47
commit
48d5ad7569
@ -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;
|
||||
});
|
||||
|
||||
@ -31,7 +31,7 @@ return [
|
||||
'show_error_msg' => true,
|
||||
'exception_tmpl' => \think\facade\App::getAppPath() . 'view/exception.tpl',
|
||||
|
||||
'version' => '1028',
|
||||
'version' => '1029',
|
||||
|
||||
'dbversion' => '1023'
|
||||
];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user