From 386ceeac70c1caacc3e2b643f4c1104c947f72ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cwanyongkang=E2=80=9D?= <“937888580@qq.com”> Date: Thu, 14 Apr 2022 18:06:46 +0800 Subject: [PATCH] =?UTF-8?q?=E7=81=AB=E7=8B=90=E7=BA=BF=E8=B7=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/linedata/auto_format.php | 7 ++++++- script/linedata/display.php | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/script/linedata/auto_format.php b/script/linedata/auto_format.php index f8fbe10..892c62a 100644 --- a/script/linedata/auto_format.php +++ b/script/linedata/auto_format.php @@ -215,7 +215,12 @@ function format_product($file_path, $dns = '') $data['status'] = $info[8] ?? ''; if ($dns != 'shihui') { $ip = explode('.', ($info[9] ?? '')); - $data['nasname'] = $ip[0] ? ip_repeat($record, $ip[0]) . '.' . $dns : ''; + + if (count($ip) == 4) { + $data['nasname'] = $info[9]; + } else { + $data['nasname'] = $ip[0] ? ip_repeat($record, $ip[0]) . '.' . $dns : ''; + } } else { $data['nasname'] = $info[9] ?? ''; } diff --git a/script/linedata/display.php b/script/linedata/display.php index 268b238..413fcb5 100755 --- a/script/linedata/display.php +++ b/script/linedata/display.php @@ -5,7 +5,7 @@ * @Author: kangkang * @Date: 2020-11-06 14:32:57 * @LastEditors: Please set LastEditors - * @LastEditTime: 2020-11-27 10:32:41 + * @LastEditTime: 2022-04-14 17:50:48 */ header('Access-Control-Allow-Origin: *'); header("Access-Control-Allow-Methods: *"); @@ -58,6 +58,10 @@ switch ($id) { case 19: get_product(__DIR__ . '/data/download/huohu.csv'); break; + + case 22: + get_product(__DIR__ . '/data/download/huohu.csv'); + break; } function get_all_product($file_path)