service == '') { $this->service = new JourneyService(); } return $this->service; } /** * User: wangxj * * 绑定订单 * * @params * * @return string */ public function bindAction(){ $checkLogin = LoginTool::checkLogin(); if($checkLogin['flag'] == false) { return json_encode($checkLogin); } $user = new User(); $para_order_id = $this->_post('para_order_id'); $para_tel = $this->_post('para_tel'); //微信openid $para_open_id = $user->getWeChatOpenId(LoginTool::$userId); $result = $user->bindOrder($para_order_id, $para_tel, $para_open_id, LoginTool::$userId) ; return Util::returnJsSu('', $result); } /** * User: wangxj * * 获取行程列表 * * @return array ['flag'=> true, 'msg'=> '信息提示', 'code'=> 3, 'data'=>[['type'=>1,'order_id'=>'113214', 'run_date'=>'2016-11-11', 'run_time'=>'08:46', * 'minutes'=>70, 'start_res_area_name'=>'上海',' start_res_name '=>'**集散中心',' end_res_area_name '=>'乌镇',' end_res_name '=>'西栅1号停车场',' e_ticket:'=>'9827988923',' line_name '=>'',' line_add '=>''],[...]] */ public function getListAction(){ $checkLogin = LoginTool::checkLogin(); if($checkLogin['flag'] == false) { return json_encode($checkLogin); } $user = new User(); $current_day = date("Y-m-d"); $orderList = $user->getOrder(LoginTool::$userId, " o.order_status = 146 AND o.run_date >= '{$current_day}' "); return Util::returnJsSu('',$orderList); } /** * User: wangxj * * 获取电子车票二维码,根据订单号生成二维码和检票信息,返回二维码URL路径,订单信息 * * @order_id * * @return string */ public function getETicketAction(){ $checkLogin = LoginTool::checkLogin(); if($checkLogin['flag'] == false) { return json_encode($checkLogin); } $result = array(); $order_id = $this->_post('order_id', '000000'); $order = new OrderMain(); $order = $order->getOrderDetail($order_id); $result['date'] = $order['RUN_DATE']; $result['time'] = $order['RUN_TIME']; $ticket = new OrderCheckTickets(); $ticket = $ticket->getTicket($order_id); $result['status'] = $ticket['status']==1?true:false; if($order['RUN_DATE'] == date('Y-m-d', time())){ $week = '今天'; } else{ $week = Tool::getWeek($order['RUN_DATE']); } $result['week'] = $week; $result['start_res_area_name'] = $order['PROD_START_STATION_AREA_NAME']; $result['start_res_name'] = $order['PROD_START_STATION_RES_NAME']; $result['end_res_area_name'] = $order['PROD_END_STATION_AREA_NAME']; $result['end_res_name'] = $order['PROD_END_STATION_RES_NAME']; $order = new OrderMain(); $count = $order->getOrderCount($order_id); $result['count'] = $count; $ser = new OrderService(); $result['eurl'] = $ser->getETicket($order_id); return Util::returnJsSu('',$result); } /** * Function Description:我要找车 * Function Name: findCarAction * * @return string * * @author 张帅 */ public function findCarAction(){ // $checkLogin = LoginTool::checkLogin(); // if($checkLogin['flag'] == false) { // return json_encode($checkLogin); // } $order_id = $this->_post('order_id');//订单id $run_date = $this->_post('run_date');//出行日期 if(empty($order_id) || empty($run_date)){ return Util::returnJsEr('参数不全'); } $result = $this->getService()->findCar($order_id,$run_date); return $result; } }