线路表
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
* @version:
|
||||
* @Author: kangkang
|
||||
* @Date: 2020-11-03 11:04:15
|
||||
* @LastEditors: kangkang
|
||||
* @LastEditTime: 2020-11-13 15:19:10
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @LastEditTime: 2020-11-26 09:37:42
|
||||
*/
|
||||
|
||||
$is_script = 1;
|
||||
@@ -219,11 +219,19 @@ function xingxing_getList($data, &$file, &$all, $exit)
|
||||
}
|
||||
|
||||
$record['ip'] = strpos($info['description2'], '-') ? explode('-', $info['description2'])[1] : $info['description2'];
|
||||
$record['daikuan'] = '';
|
||||
$record['daikuan'] = $info['bandwidth'];
|
||||
$record['onlineuser'] = '';
|
||||
$record['maxuser'] = '';
|
||||
$record['online'] = $online[$info['online']];
|
||||
$status_flag = $info['onlineuser'] / $info['maxuser'];
|
||||
$record['status'] = '';
|
||||
if ($status_flag < 1) {
|
||||
$record['status'] = '正常';
|
||||
} elseif ($status_flag < 1.3) {
|
||||
$record['status'] = '拥挤';
|
||||
} else {
|
||||
$record['status'] = '满载';
|
||||
}
|
||||
$record['nasname'] = $info['nasname'];
|
||||
if (!in_array($record['nasname'], $exit) && !in_array($record['nasname'], $dnx_has_exit)) {
|
||||
fputcsv($dnx_exit, ['星星', $record['nasname'], date('Y-m-d H:i:s')]);
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
* @version:
|
||||
* @Author: kangkang
|
||||
* @Date: 2020-11-07 11:13:08
|
||||
* @LastEditors: kangkang
|
||||
* @LastEditTime: 2020-11-16 11:20:35
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @LastEditTime: 2020-11-26 09:39:13
|
||||
*/
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
header("Access-Control-Allow-Methods: *");
|
||||
@@ -122,7 +122,7 @@ function search_all_product($file_path,$search){
|
||||
$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];
|
||||
}
|
||||
@@ -241,17 +241,18 @@ function search_xingxing($file_path1,$file_path2,$dns){
|
||||
echo json_encode(['data'=>$list]);
|
||||
}
|
||||
|
||||
function ip_repeat(&$record,$ip){
|
||||
for ($i=2;$i<100;$i++){
|
||||
if(in_array($ip,$record)){
|
||||
if(in_array($ip.'v'.$i,$record)){
|
||||
function ip_repeat(&$record, $ip, $dns ='')
|
||||
{
|
||||
for ($i = 2; $i < 100; $i++) {
|
||||
if (in_array($ip.$dns, $record)) {
|
||||
if (in_array($ip .$dns. 'v' . $i, $record)) {
|
||||
continue;
|
||||
} else {
|
||||
$record[] = $ip.'v'.$i;
|
||||
return $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