From 7d4230ad4a4746ac4f6a409278e2a849409843d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cwanyongkang=E2=80=9D?= <“937888580@qq.com”> Date: Tue, 1 Jun 2021 14:59:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9E=81=E5=AE=A2=E8=A5=BF=E7=93=9C=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E5=9C=B0=E5=8C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/product/controller/AccountAddress.php | 84 ++++++++++++++++++++++- 1 file changed, 82 insertions(+), 2 deletions(-) diff --git a/app/product/controller/AccountAddress.php b/app/product/controller/AccountAddress.php index fcca078..109f538 100644 --- a/app/product/controller/AccountAddress.php +++ b/app/product/controller/AccountAddress.php @@ -10,9 +10,46 @@ class AccountAddress { $info = $_GET; $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); - // 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() @@ -34,6 +71,49 @@ class AccountAddress 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 public function getList() {