From b58c37575baef7b595bb0667394be468ce3780cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cwanyongkang=E2=80=9D?= <“937888580@qq.com”> Date: Thu, 2 Sep 2021 13:52:39 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=BF=E8=B7=AF=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/linedata/get_line_list.php | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/script/linedata/get_line_list.php b/script/linedata/get_line_list.php index f87fe40..796774e 100755 --- a/script/linedata/get_line_list.php +++ b/script/linedata/get_line_list.php @@ -18,7 +18,11 @@ $product_list = $product_model->field('Id,Token')->fetchAll(); // $apikey = '80cf4f64e990b78a9fc5eb'; // $url = "http://rds-api.juip.com/server/index/getList?apikey=".$apikey; // $mogu = json_decode(file_get_contents($url), true)['data']; -// mogu_getList($mogu, $mogu_f, $all, $mogu_data, '蘑菇'); +// dump($mogu);die; +// $mogu_data = get_product(__DIR__ . '/data/mogu.csv'); +// $mogu_f = fopen(__DIR__ . '/data/mogu.csv', 'w'); +// mogu_getList($mogu, $mogu_f, $all, $mogu_data); +// fclose($mogu_f); // die; /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //强子迅联特征码 @@ -52,13 +56,13 @@ $dnx_exit = fopen(__DIR__ . '/data/dns_diff.csv', 'a'); $dnx_has_exit = get_product(__DIR__ . '/data/dns_diff.csv', 1); //----------------------------------------------------------------------------------------------------- $apikey = '80cf4f64e990b78a9fc5eb'; -$url = "http://rds-api.juip.com/server/index/getList?apikey=".$apikey; -$mogu_data = get_product(__DIR__ . '/data/mogu.csv'); -$mogu_f = fopen(__DIR__ . '/data/mogu.csv', 'w'); +$url = "http://rds-api.juip.com/api/index/getList?apikey=".$apikey; $mogu = json_decode(file_get_contents($url), true)['data']; -mogu_getList($mogu, $mogu_f, $all, $mogu_data); -fclose($mogu_f); - +if ($mogu) { + $mogu_f = fopen(__DIR__ . '/data/mogu.csv', 'w'); + mogu_getList($mogu, $mogu_f, $all); + fclose($mogu_f); +} $time = time(); $noce = md5(time()); @@ -517,10 +521,8 @@ function tiantian_getList($data, &$file, &$all, $exit, $product_name) //蘑菇服务器解析规则 -function mogu_getList($data, &$file, &$all, $exit, $product_name='蘑菇') +function mogu_getList($data, &$file, &$all ) { - global $dnx_exit, $dnx_has_exit; - $status = ['故障', '正常']; $key = ''; $list1 = []; // print_r($data); @@ -564,7 +566,7 @@ function mogu_getList($data, &$file, &$all, $exit, $product_name='蘑菇') $record['daikuan'] = $info['daikuan']; $record['onlineuser'] = ''; $record['maxuser'] = ''; - $record['online'] = $info['status'] ? '正常' : '故障'; + $record['online'] = $info['status']; $record['status'] = ''; $record['nasname'] = $info['address']; $list1[$key][] = $record;