You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

44 lines
960 B

  1. <?php
  2. header("Access-Control-Allow-Origin:*");
  3. //载入配置文件和连接数据库
  4. //获取地名
  5. $user_id=$_COOKIE['user_id'];
  6. $bus_type = $_POST['bus_type'];
  7. if (!$user_id) {
  8. echo json_encode(array("code" => 1,"iflogin"=>1, "info" => "用户未登录"));
  9. exit ;
  10. }
  11. $area = $_POST['area_name'];
  12. $area_line = get_memcache('ARY_LINE_POI');
  13. $area_line = $area_line[$bus_type];
  14. if(empty($area)){
  15. $list = $area_line;
  16. sort($list);
  17. }else{
  18. $area_array_line = array();
  19. foreach($area_line as $k => $v){
  20. if(strpos($v['area_name'],$area) !== false){
  21. $area_array_line[] = $v;
  22. }
  23. }
  24. $list = $area_array_line;
  25. }
  26. $code = 0;
  27. $info = $CODE[0];
  28. $json = array();
  29. $json['code'] = $code;
  30. $json['info'] = $info;
  31. $json['list'] = $list;
  32. //print_r($json);
  33. echo json_encode($json);
  34. ?>