线路表
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
* @version:
|
||||
* @Author: kangkang
|
||||
* @Date: 2020-11-06 14:32:57
|
||||
* @LastEditors: kangkang
|
||||
* @LastEditTime: 2020-11-19 09:21:56
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @LastEditTime: 2020-11-25 19:50:43
|
||||
*/
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
header("Access-Control-Allow-Methods: *");
|
||||
@@ -114,7 +114,7 @@ function format_all_product($file_path)
|
||||
$data['status'] = $info[8]??'';
|
||||
if ($dns != 'shihui') {
|
||||
$ip = explode('.', ($info[9]??''));
|
||||
$data['nasname'] = $ip[0] ? ip_repeat($record, $ip[0]) . '.' . $dns : '';
|
||||
$data['nasname'] = $ip[0] ? ip_repeat($record, $ip[0],$dns) . '.' . $dns : '';
|
||||
} else {
|
||||
$data['nasname'] = $info[9]??'';
|
||||
}
|
||||
@@ -262,18 +262,18 @@ function format_xingxing($file_path1, $file_path2, $dns)
|
||||
echo json_encode(['data' => $list, 'count' => $count, 'use_count' => $user_count]);
|
||||
}
|
||||
|
||||
function ip_repeat(&$record, $ip)
|
||||
function ip_repeat(&$record, $ip, $dns ='')
|
||||
{
|
||||
for ($i = 2; $i < 100; $i++) {
|
||||
if (in_array($ip, $record)) {
|
||||
if (in_array($ip . 'v' . $i, $record)) {
|
||||
if (in_array($ip.$dns, $record)) {
|
||||
if (in_array($ip .$dns. 'v' . $i, $record)) {
|
||||
continue;
|
||||
} else {
|
||||
$record[] = $ip . 'v' . $i;
|
||||
$record[] = $ip .$dns. 'v' . $i;
|
||||
return $ip . 'v' . $i;
|
||||
}
|
||||
} else {
|
||||
$record[] = $ip;
|
||||
$record[] = $ip.$dns;
|
||||
return $ip;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user