|
- <?php
- /**
- *
- * ============================================================================
- * * 版权所有 蜘蛛出行 * *
- * 网站地址: http://www.zhizhuchuxing.com
- * ----------------------------------------------------------------------------
- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
- * 使用;不允许对程序代码以任何形式任何目的的再发布。
- * ============================================================================
- * Author By: 张帅
- * PhpStorm BaseController.php
- * Create By 2016/11/11 17:05 $
- */
-
- namespace Trip\Controller;
-
-
- use Trip\Service\BaseService;
- use Util\Controller\MvcController;
- use Util\Util\Util;
-
- class BaseController extends MvcController
- {
- private $service;
-
- public function getService(){
- if($this->service == '') {
- $this->service = new BaseService();
- }
- return $this->service;
- }
-
- /**
- * Function Description:获取站点基础数组
- * Function Name: getStationAction
- *
- * @return string
- *
- * @author 张帅
- */
- public function getStationAction()
- {
- $station_base = $this->getService()->getPoiInfoArr();
- $line_type = $this->_post('line_type',0);//线路类型
- $poi_type = $this->_post('poi_type');//poi类型
- $poi_name = $this->_post('poi_name');//poi名字
- $inout_type = $this->_post('inout_type','in');//上下车类型 上in,下out
- $station_id = $this->_post('station_id');//已选的站点id
- $hotarr='';
- if(empty($inout_type)){
- return Util::returnJsEr('参数不全');
- }
- $poi_link = $station_base['poi_link'];
- $select_station = $station_base['select_station'];
- //不同的线路调用不同的查找方法
- switch ($line_type){
- case 318 : //景区直通
- $station_arr = $this->getService()->getScenicLine($poi_type,$poi_name,$inout_type,$station_id,$poi_link[318],$select_station[318]);
- break;
- case 319 : //城际直通
- $station_arr = $this->getService()->getIntercityLine($poi_type,$poi_name,$inout_type,$station_id,$poi_link[319],$select_station[319]);
- break;
- case 379 : //迪士尼接驳
- $station_arr = $this->getService()->getDisneyLine($poi_type,$poi_name,$inout_type,$station_id,$poi_link[379],$select_station[379]);
- break;
- case 380 : //机场接驳
- $station_arr = $this->getService()->getAirportLine($poi_type,$poi_name,$inout_type,$station_id,$poi_link[380],$select_station[380]);
- break;
- default :
- $station_arr = $this->getService()->getAllLine($poi_type,$poi_name,$inout_type,$station_id,$poi_link[0],$select_station[0]);
- break;//全部
- }
- if($line_type==0 && $poi_type==0 && $inout_type=='in'){
- $hotarr=array(
- 0=>array(
- 'area_id'=>'791',
- 'area_name'=>'上海市'
- ),
- 1=>array(
- 'area_id'=>'923',
- 'area_name'=>'杭州市'
- ),
- 2=>array(
- 'area_id'=>'3249',
- 'area_name'=>'虹桥火车站'
- ),
- 3=>array(
- 'area_id'=>'3256',
- 'area_name'=>'周庄'
- ),
- 4=>array(
- 'area_id'=>'3240',
- 'area_name'=>'迪士尼'
- ),
- 5=>array(
- 'area_id'=>'3226',
- 'area_name'=>'千岛湖'
- )
- );
- }
- $station_arr = array_merge($station_arr);
- if($poi_type!='' && $poi_type!='7+'){
- $station_arr=$this->getService()->getPy($station_arr);
- }
- return Util::returnJsSu('',$station_arr,$hotarr);
- }
- }
|