新产品火狐

This commit is contained in:
“wanyongkang”
2021-04-26 18:50:06 +08:00
parent 8efb5f9c5a
commit 33ff11d5ff
5 changed files with 214 additions and 18 deletions

View File

@@ -1,7 +1,7 @@
<?php
function auto_format_list(){
$product_list = [0, 1, 2, 4, 5, 6, 8, 10, 13, 14, 15, 16, 17, 18];
$product_list = [0, 1, 2, 4, 5, 6, 8, 10, 13, 14, 15, 16, 17, 18, 19];
foreach ($product_list as $product) {
switch ($product) {
case 0:
@@ -46,6 +46,9 @@ function auto_format_list(){
case 18:
format_product(__DIR__ . '/data/mogu.csv', 'mgip.net');
break;
case 19:
format_product_huohu(__DIR__ . '/data/huohu.csv');
break;
}
}
}
@@ -102,6 +105,9 @@ function format_all_product($file_path)
case '蘑菇':
$dns = 'mgip.net';
break;
case '火狐':
$dns = 'hhip';
break;
default:
$dns = 'xlip.vip';
break;
@@ -116,11 +122,13 @@ function format_all_product($file_path)
$data['maxuser'] = $info[6] ?? '';
$data['online'] = $info[7] ?? '';
$data['status'] = $info[8] ?? '';
if ($dns != 'shihui') {
if ($dns == 'shihui') {
$data['nasname'] = $info[9] ?? '';
} elseif ($dns == 'hhip'){
$data['nasname'] = '1.hhip.vip';
} else {
$ip = explode('.', ($info[9] ?? ''));
$data['nasname'] = $ip[0] ? ip_repeat($record, $ip[0], $dns) . '.' . $dns : '';
} else {
$data['nasname'] = $info[9] ?? '';
}
fputcsv($file1, $data);
}
@@ -128,6 +136,44 @@ function format_all_product($file_path)
fclose($file1);
}
//火狐
function format_product_huohu($file_path)
{
$list1 = [];
$file = fopen($file_path, 'r');
$file_path1 = explode('/', $file_path);
$file1 = fopen(__DIR__ . '/data/download/' . $file_path1[8], 'w');
$record = [];
while ($info = fgetcsv($file)) {
if (empty($info[4])) {
$key = $info[1];
}
$record['name'] = $info[0];
$record['city'] = $info[1]??'';
$record['supply'] = $info[2]??'';
$record['ip'] = '';
$record['daikuan'] = '';
$record['onlineuser'] = '';
$record['maxuser'] = '';
$record['online'] = '正常';
$record['status'] = '';
if(!empty($info[4])){
$record['nasname'] = '1.hhip.vip';
}
$list1[$key][] = $record;
}
foreach ($list1 as $k => $val) {
foreach ($val as $net_data) {
fputcsv($file1, $net_data);
}
}
fclose($file1);
fclose($file);
}
function format_product($file_path, $dns = '')
{
$list1 = [];