|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- <?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);
- }
- }
|