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.
 
 
 
 
 
 

109 lines
4.0 KiB

  1. <?php
  2. /**
  3. *
  4. * ============================================================================
  5. * * 版权所有 蜘蛛出行 * *
  6. * 网站地址: http://www.zhizhuchuxing.com
  7. * ----------------------------------------------------------------------------
  8. * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
  9. * 使用;不允许对程序代码以任何形式任何目的的再发布。
  10. * ============================================================================
  11. * Author By: 张帅
  12. * PhpStorm BaseController.php
  13. * Create By 2016/11/11 17:05 $
  14. */
  15. namespace Trip\Controller;
  16. use Trip\Service\BaseService;
  17. use Util\Controller\MvcController;
  18. use Util\Util\Util;
  19. class BaseController extends MvcController
  20. {
  21. private $service;
  22. public function getService(){
  23. if($this->service == '') {
  24. $this->service = new BaseService();
  25. }
  26. return $this->service;
  27. }
  28. /**
  29. * Function Description:获取站点基础数组
  30. * Function Name: getStationAction
  31. *
  32. * @return string
  33. *
  34. * @author 张帅
  35. */
  36. public function getStationAction()
  37. {
  38. $station_base = $this->getService()->getPoiInfoArr();
  39. $line_type = $this->_post('line_type',0);//线路类型
  40. $poi_type = $this->_post('poi_type');//poi类型
  41. $poi_name = $this->_post('poi_name');//poi名字
  42. $inout_type = $this->_post('inout_type','in');//上下车类型 上in,下out
  43. $station_id = $this->_post('station_id');//已选的站点id
  44. $hotarr='';
  45. if(empty($inout_type)){
  46. return Util::returnJsEr('参数不全');
  47. }
  48. $poi_link = $station_base['poi_link'];
  49. $select_station = $station_base['select_station'];
  50. //不同的线路调用不同的查找方法
  51. switch ($line_type){
  52. case 318 : //景区直通
  53. $station_arr = $this->getService()->getScenicLine($poi_type,$poi_name,$inout_type,$station_id,$poi_link[318],$select_station[318]);
  54. break;
  55. case 319 : //城际直通
  56. $station_arr = $this->getService()->getIntercityLine($poi_type,$poi_name,$inout_type,$station_id,$poi_link[319],$select_station[319]);
  57. break;
  58. case 379 : //迪士尼接驳
  59. $station_arr = $this->getService()->getDisneyLine($poi_type,$poi_name,$inout_type,$station_id,$poi_link[379],$select_station[379]);
  60. break;
  61. case 380 : //机场接驳
  62. $station_arr = $this->getService()->getAirportLine($poi_type,$poi_name,$inout_type,$station_id,$poi_link[380],$select_station[380]);
  63. break;
  64. default :
  65. $station_arr = $this->getService()->getAllLine($poi_type,$poi_name,$inout_type,$station_id,$poi_link[0],$select_station[0]);
  66. break;//全部
  67. }
  68. if($line_type==0 && $poi_type==0 && $inout_type=='in'){
  69. $hotarr=array(
  70. 0=>array(
  71. 'area_id'=>'791',
  72. 'area_name'=>'上海市'
  73. ),
  74. 1=>array(
  75. 'area_id'=>'923',
  76. 'area_name'=>'杭州市'
  77. ),
  78. 2=>array(
  79. 'area_id'=>'3249',
  80. 'area_name'=>'虹桥火车站'
  81. ),
  82. 3=>array(
  83. 'area_id'=>'3256',
  84. 'area_name'=>'周庄'
  85. ),
  86. 4=>array(
  87. 'area_id'=>'3240',
  88. 'area_name'=>'迪士尼'
  89. ),
  90. 5=>array(
  91. 'area_id'=>'3226',
  92. 'area_name'=>'千岛湖'
  93. )
  94. );
  95. }
  96. $station_arr = array_merge($station_arr);
  97. if($poi_type!='' && $poi_type!='7+'){
  98. $station_arr=$this->getService()->getPy($station_arr);
  99. }
  100. return Util::returnJsSu('',$station_arr,$hotarr);
  101. }
  102. }