极客西瓜选择地区
This commit is contained in:
@@ -10,9 +10,46 @@ class AccountAddress
|
|||||||
{
|
{
|
||||||
$info = $_GET;
|
$info = $_GET;
|
||||||
$url = 'http://city.webok.me/apichange/?user='.$info['user'].'&password='.$info['password'].'&type=getline';
|
$url = 'http://city.webok.me/apichange/?user='.$info['user'].'&password='.$info['password'].'&type=getline';
|
||||||
|
$current_url = 'http://city.webok.me/apichange/?user='.$info['user'].'&password='.$info['password'].'&type=current_line';
|
||||||
|
|
||||||
|
//获取已经选择的地区
|
||||||
|
$selected_address = json_decode(file_get_contents($current_url),true);;
|
||||||
|
$selected_id = explode(',',$selected_address['data']['default_line']);
|
||||||
|
unset($selected_id[count($selected_id)-1]);
|
||||||
|
|
||||||
$data = json_decode(file_get_contents($url),true);
|
$data = json_decode(file_get_contents($url),true);
|
||||||
// dump($data['data']);
|
//对已经选择的地区进行处理
|
||||||
echo json_encode($data['data']);
|
$list = [];
|
||||||
|
foreach($data['data'] as $info) {
|
||||||
|
if(in_array($info['id'],$selected_id)){
|
||||||
|
$list[] = $info['name'].'-'.$info['id'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$data['list'] = $list;
|
||||||
|
echo json_encode($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function index2()
|
||||||
|
{
|
||||||
|
$info = $_GET;
|
||||||
|
$url = 'http://city.webok.me/apichange2/?user='.$info['user'].'&password='.$info['password'].'&type=getline';
|
||||||
|
$current_url = 'http://city.webok.me/apichange2/?user='.$info['user'].'&password='.$info['password'].'&type=current_line';
|
||||||
|
|
||||||
|
//获取已经选择的地区
|
||||||
|
$selected_address = json_decode(file_get_contents($current_url),true);;
|
||||||
|
$selected_id = explode(',',$selected_address['data']['default_line']);
|
||||||
|
unset($selected_id[count($selected_id)-1]);
|
||||||
|
|
||||||
|
$data = json_decode(file_get_contents($url),true);
|
||||||
|
//对已经选择的地区进行处理
|
||||||
|
$list = [];
|
||||||
|
foreach($data['data'] as $info) {
|
||||||
|
if(in_array($info['id'],$selected_id)){
|
||||||
|
$list[] = $info['name'].'-'.$info['id'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$data['list'] = $list;
|
||||||
|
echo json_encode($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function select()
|
public function select()
|
||||||
@@ -34,6 +71,49 @@ class AccountAddress
|
|||||||
echo $content;
|
echo $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function indexXigua()
|
||||||
|
{
|
||||||
|
$info = $_GET;
|
||||||
|
$url = 'http://www.yzip.vip/apichange/?user='.$info['user'].'&password='.$info['password'].'&type=getline';
|
||||||
|
$current_url = 'http://www.yzip.vip/apichange/?user='.$info['user'].'&password='.$info['password'].'&type=current_line';
|
||||||
|
|
||||||
|
//获取已经选择的地区
|
||||||
|
$selected_address = json_decode(file_get_contents($current_url),true);;
|
||||||
|
$selected_id = explode(',',$selected_address['data']['default_line']);
|
||||||
|
unset($selected_id[count($selected_id)-1]);
|
||||||
|
|
||||||
|
$data = json_decode(file_get_contents($url),true);
|
||||||
|
//对已经选择的地区进行处理
|
||||||
|
$list = [];
|
||||||
|
foreach($data['data'] as $info) {
|
||||||
|
if(in_array($info['id'],$selected_id)){
|
||||||
|
$list[] = $info['name'].'-'.$info['id'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$data['list'] = $list;
|
||||||
|
echo json_encode($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function selectXigua()
|
||||||
|
{
|
||||||
|
$data = json_decode(file_get_contents("php://input"),true);
|
||||||
|
$add_text = '';
|
||||||
|
$add_id = '';
|
||||||
|
$account = $data['account'];
|
||||||
|
$password = $data['password'];
|
||||||
|
foreach ($data['list'] as $info) {
|
||||||
|
$temp = explode('-',$info);
|
||||||
|
$add_text .= $temp[0].',';
|
||||||
|
$add_id .= $temp[1].',';
|
||||||
|
}
|
||||||
|
$url = 'http://www.yzip.vip/apichange/?user='.$account.'&password='.$password.'&type=edit¤t_line_list='.$add_text.'&line_id_list='.$add_id;
|
||||||
|
|
||||||
|
$content = linkcurl($url,'GET',[],[],0);
|
||||||
|
|
||||||
|
echo $content;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//火狐ip
|
//火狐ip
|
||||||
public function getList()
|
public function getList()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user