diff --git a/script/linedata/auto_format.php b/script/linedata/auto_format.php index 0128e92..95584eb 100644 --- a/script/linedata/auto_format.php +++ b/script/linedata/auto_format.php @@ -66,6 +66,9 @@ function auto_format_list(){ case 27: format_product(__DIR__ . '/data/qilin.csv','qlip.cc'); break; + case 28: + format_shuidi_product(__DIR__ . '/data/shuidi.csv','sdip.cc'); + break; } } } @@ -266,6 +269,49 @@ function format_product($file_path, $dns = '') fclose($file); } +function format_shuidi_product($file_path, $dns = '') +{ + $list1 = []; + $list = []; + $user_count = 0; + $count = 0; + $key = ''; + $citys = []; + $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 (in_array($info['1'], ['曾', '龙'])) { + continue; + } + if (empty($info[9])) { + $key = $info[1]; + } + $data['name'] = $info[0]; + $city = city_exist($citys, $info[1]); + $citys[] = $city; + $data['city'] = $city; + $data['supply'] = $info[2] ?? ''; + $data['ip'] = $info[3] ?? ''; + $data['daikuan'] = $info[4] ?? ''; + $data['onlineuser'] = $info[5] ?? ''; + $data['maxuser'] = $info[6] ?? ''; + $data['online'] = $info[7] ?? ''; + $data['status'] = $info[8] ?? ''; + $data['nasname'] = $info[9] ?? ''; + $list1[$key][] = $data; + } + + foreach ($list1 as $k => $val) { + foreach ($val as $net_data) { + + fputcsv($file1, $net_data); + } + } + fclose($file1); + fclose($file); +} function format_xingxing($file_path1, $file_path2, $dns) { $list1 = [];