service == null) { $this->service = new Travel(); } return $this->service; } /** * Des:添加评论 * Name: actionAddTravel * @return string * @author 孙彤 */ public function actionAddTravel() { $param = [ 'travel_id' => $this->_post('travel_id', ''), 'prod_id' => $this->_post('prod_id', ''), 'star' => $this->_post('star', ''), 'content' => $this->_post('content', '') ]; $addFlag = $this->service()->AddTravel($param); if ($addFlag['flag'] == false) { return Util::returnJsEr($addFlag['msg']); } return Util::returnJsSu(); } /** * Des:获取用户的行程列表 * Name: actionGetTravelList * @return string * @author 倪宗锋 */ public function actionGetTravelList() { $params = [ 'current_page' => $this->_post('current_page', 1),//分页 'page_size' => $this->_post('page_size', 10),//每页展示条数 'status_id' => $this->_post('status_id', 1),//每页展示条数 'u_id' => LoginService::$uid ]; $getList = $this->service()->getTravelList($params); return Util::returnJsSu('', ['list' => $getList['data']]); } /** * Des:获取巴士定位 * Name: actionGetBusPosition * @return string * @author 倪宗锋 */ public function actionGetBusPosition() { $param = [ 'order_id' => $this->_post('order_id'),//订单ID 'travel_id' => $this->_post('travel_id'),//行程ID 'run_date' => $this->_post('run_date'),//出发时间 'action' => 'get_bus_position' ]; $orderTravel = new OrderTravel(); $getInfo = $orderTravel->getInfoByTravelId($param); if (empty($getInfo['cs_order_id'])) { return Util::returnJsSu('无效行程!'); } $startTime = strtotime($getInfo['start_time_all']); $theTime = time(); $canTel = true; if ($startTime - $theTime >= 900 || $theTime - $startTime >= 3600 * 12) { $canTel = false; } $getResult = Util::sendCs($param, '/api/wx/', 2); if ($getResult['flag'] == true) { $return = $getResult['data']['list']; $return['cantel'] = $canTel; return Util::returnJsSu('', $return); } return Util::returnJsEr($getResult['msg']); } /** * Des:发送短信通知 * Name: actionSendTravelMsg * @return string * @author 倪宗锋 */ public function actionSendTravelMsg() { $param = [ 'order_id' => $this->_post('order_id', 1013728),//订单ID 'flag' => 1, 'action' => 'wechat_click_message' ]; $getResult = Util::sendCs($param, '/api/wx/', 2); if ($getResult['flag'] == true) { return Util::returnJsSu(''); } return Util::returnJsEr($getResult['msg']); } /** * Des:预定短信通知 * Name: actionBookTravelMsg * @return string * @author 倪宗锋 */ public function actionBookTravelMsg() { $param = [ 'order_id' => $this->_post('order_id', 1013728),//订单ID 'flag' => 1, 'action' => 'appoint_send_message' ]; $getResult = Util::sendCs($param, '/api/wx/', 2); if ($getResult['flag'] == true) { return Util::returnJsSu(''); } return Util::returnJsEr($getResult['msg']); } /** * Des:选择页面初始化 * Name: actionChoseSeat * @return string * @author 倪宗锋 */ public function actionInitChoseSeat() { $travel_id = (int)$this->_post('travel_id', '');//行程ID if (Util::checkPattern('intVal', $travel_id) == false) { return Util::returnJsEr('params error', '', 'trip_list.html'); } $initChoseSeat = $this->service()->initChoseSeat($travel_id); if ($initChoseSeat['flag'] == true) { return Util::returnJsSu('', $initChoseSeat['data']); } return Util::returnJsEr($initChoseSeat['msg']); } /** * Des:选择座位 * Name: actionChoseSeat * @return string * @author 倪宗锋 */ public function actionChoseSeat() { $travel_id = (int)$this->_post('travel_id', '');//行程ID $seq_id = trim($this->_post('seq_id', ''));//序号ID if (Util::checkPattern('intVal', $travel_id) == false) { return Util::returnJsEr('参数异常!'); } if (empty($seq_id)) { return Util::returnJsEr('请选择座位!'); } $choseSeat = $this->service()->choseSeat($travel_id, $seq_id); if ($choseSeat['flag'] == true) { return Util::returnJsSu(''); } return Util::returnJsEr($choseSeat['msg']); } /** * Function Description:查看座位 * Function Name: actionWatchSeats * * @return string * * @author 李健 */ public function actionWatchSeats() { $travel_id = (int)$this->_post('travel_id', '');//行程ID if (Util::checkPattern('intVal', $travel_id) == false) { return Util::returnJsEr('params error', '', '/web/zzcx/trip_list.html'); } $watchSeat = $this->service()->watchSeat($travel_id); if ($watchSeat['flag'] == true) { return Util::returnJsSu('',$watchSeat['data']['data']); } return Util::returnJsEr($watchSeat['msg']); } }