service == '') { $this->service = new MyTripService(); } return $this->service; } /** * Function Description:我的行程列表页 * Function Name: indexAction * * @return string * * @author 娄梦宁 */ public function indexAction(){ $checkLogin = LoginTool::checkLogin();//校验用户登录状态 if($checkLogin['flag'] == false) { return json_encode($checkLogin); } $userId = LoginTool::$userId; $limit=empty($_POST['page_size']) ? 10 :$_POST['page_size']; $arr=array( 'userId'=>$userId, 'page'=>$_POST['current_page'], 'limit'=>$limit, 'type'=>$_POST['type'] ); $result=$this->getService()->indexList($arr); if($result['flag']==false && $result['msg']!='参数错误'){ $result['data']=array( 'list'=>array(), 'page'=>array( 'current_page'=>$_POST['current_page'], 'page_size'=>$limit ) ); $result['flag']='true'; } return json_encode($result); } /** * Function Description:获取电子票 * Function Name: eticketAction * * @return string * * @author 娄梦宁 */ public function eticketAction(){ $checkLogin = LoginTool::checkLogin();//校验用户登录状态 if($checkLogin['flag'] == false) { return json_encode($checkLogin); } $userId = LoginTool::$userId; $arr=array( 'userId'=>$userId, 'order_id'=>$_POST['order_id'] ); $result=$this->getService()->getEticket($arr); return json_encode($result); } /** * Function Description:绑定行程 * Function Name: tripBindAction * * @return string * * @author 娄梦宁 */ public function tripbindAction(){ $checkLogin = LoginTool::checkLogin();//校验用户登录状态 if($checkLogin['flag'] == false) { return json_encode($checkLogin); } $userId = LoginTool::$userId; $arr=array( 'userId'=>$userId, 'tel'=>$_POST['phone'] ); $result=$this->getService()->tripBind($arr); return json_encode($result); } }