|
- <?php
- /**
- *
- * ============================================================================
- * * 版权所有 蜘蛛出行 * *
- * 网站地址: http://www.zhizhuchuxing.com
- * ----------------------------------------------------------------------------
- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
- * 使用;不允许对程序代码以任何形式任何目的的再发布。
- * ============================================================================
- * Author By: 娄梦宁
- * PhpStorm MyTripController.php
- * Create By 2016/11/29 9:17 $
- */
-
-
- namespace MyTrip\Controller;
-
-
- use Base\Tool\LoginTool;
- use MyTrip\Service\MyTripService;
- use Util\Controller\MvcController;
-
- class MyTripController extends MvcController
- {
- private $service;
- public function getService(){
- if($this->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);
- }
- }
|