|
- <?php
- /*
- Author:XM
- Compeny:Spiders Travel
- */
-
- require_once '../../Common/Mysql.php';
- if (ALLOW_ORIGIN)
- header("Access-Control-Allow-Origin:*");
-
-
-
- $order_id = isset($_POST['order_id'])?$_POST['order_id']:'';
- if(!$order_id){
- echo json_encode(array('code'=>'1','info'=>'订单号有误'));die;
- }
- $pdo=conn();
- $list = Find($order_id);
- if(!$list){
- echo json_encode(array('code'=>'1','info'=>'订单号有误'));die;
- }
- $sql = "SELECT SEND_BUS_NO,SEND_DRIVER_NAME,SEND_DRIVER_MOBILE FROM RUN_BUS WHERE CANCEL_FLAG=0 AND RUN_ID=" . $list["run_id"] . " AND BUS_ORDER_ID=" . $list["bus_order"];
- $pdo = conn();
- $result = $pdo -> query($sql);
- $rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
-
- //var_dump($rowset);
- $order_bus_no = "暂未指派";
- //车牌号
- $order_driver_name = "暂未指派";
- //司机名称
- $driver_mobile ='暂未指派';
-
- if (!empty($rowset[0]["SEND_BUS_NO"])) {
- $driver_mobile = $rowset[0]['SEND_DRIVER_MOBILE'];
- $order_bus_no = $rowset[0]["SEND_BUS_NO"];
- $order_driver_name = $rowset[0]["SEND_DRIVER_NAME"];
- }
-
-
- $data =array();
- $data['line_name']=$list['line_name'];
- $data['start_station']=$list['start_station'];
- $data['start_res_name']=$list['start_res_name'];
- $data['end_station']=$list['end_station'];
- $data['end_res_name']=$list['end_res_name'];
- $data['run_time']=$list['run_time'];
- $data['bus_order']=$list['bus_order'];
- $data['CUSTOMER_NAME']=$list['CUSTOMER_NAME'];
- $data['CUSTOMER_MOBILE']=$list['CUSTOMER_MOBILE'];
- $data['bus_no']=$order_bus_no;
- $data['driver_name']=$order_driver_name;
- $data['driver_mobile']=$driver_mobile;
- $data['order_status']=$list['order_status'];
- $data['order_price']=$list['order_price'];
- $data['order_id']=$order_id;
- if($data['order_status'] == 145){
- $data['order_status_2']='待支付';
- }elseif($data['order_status'] == 146){
- $data['order_status_2']='已出票';
- }elseif($data['order_status'] == 147){
- $data['order_status_2']='已出行';
- }elseif($data['order_status'] == 148){
- $data['order_status_2']='已取消';
- }
- $data['time']=array(substr($list['create_time'],0,10),substr($list['create_time'],11,5),substr($list['pay_time'],0,10),substr($list['pay_time'],11,5),$list['run_date'],$list['run_time']);
- $data['tic_count']=$list['count'];
- echo json_encode(array('code'=>'0','data' =>$data));
-
-
-
-
- function Find($order_id){
- $pdo= conn1();
- $sql = "select order_description,order_price,order_pay_main_id "
- . "from order_main "
- . "where order_id=".$order_id;
- $result=$pdo->query($sql);
- if(!$result){
- return FALSE;
- }
- $rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
- $order_price = $rowset[0];//订单总价格 订单票的数量
- $sql = "SELECT DISTINCT
- order_description,parent_order_id,create_time,order_pay_time,order_status,run_id,parent_prod_name,CUSTOMER_NAME,CUSTOMER_MOBILE,run_date,run_bus_order_id,run_time,PROD_START_STATION_AREA_NAME,PROD_START_STATION_RES_NAME,PROD_END_STATION_AREA_NAME,PROD_END_STATION_RES_NAME
- FROM `order_main`
- where PARENT_ORDER_ID=".$order_id;
- $result=$pdo->query($sql);
- $rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
- $order_station = $rowset[0];//订单来往地址 订单时间 订单好
- if(empty($order_station))
- return false;
- $array_order_desc=array();
-
- $arr_temp = explode('|',$order_price['order_description']);
- $arr=array();
- foreach ($arr_temp as $k=>$v2) {
- if(!empty($v2))
- $array_order_desc[]= explode (',', $v2); //订单票 * 数量
- }
- $list = array();
- //上海(黄浦旅游集散站) - 乌镇(西栅1号停车场)//反的数组
- $list['station'] = $order_station['PROD_START_STATION_AREA_NAME'].'('.$order_station['PROD_START_STATION_RES_NAME'].')'
- .'-'.$order_station['PROD_END_STATION_AREA_NAME'].'('.$order_station['PROD_END_STATION_RES_NAME'].')';
- $list['start_station']=$order_station['PROD_START_STATION_AREA_NAME'];
- $list['end_station']=$order_station['PROD_END_STATION_AREA_NAME'];
- $list['start_res_name'] = $order_station['PROD_START_STATION_RES_NAME'];
- $list['end_res_name'] = $order_station['PROD_END_STATION_RES_NAME'];
- $list['run_date'] = $order_station['run_date'];
- $list['run_time'] = $order_station['run_time'];
- $list['count']='';
- $list['line_name'] = $order_station['parent_prod_name'];
- $list['bus_order'] = $order_station['run_bus_order_id'];
- $list['CUSTOMER_NAME'] = $order_station['CUSTOMER_NAME'];
- $list['CUSTOMER_MOBILE'] = $order_station['CUSTOMER_MOBILE'];
- $list['create_time'] = $order_station['create_time'];
- $list['pay_time'] = $order_station['order_pay_time'];
- foreach ($array_order_desc as $v){
- $list['count'] .= ' '.$v[0].' × '.$v[2];
- }
- $list['order_price'] = $order_price['order_price'];
- $sql = "select pay_serial_number from order_pay_detail where pay_main_id =".$order_price['order_pay_main_id'];
- $result=$pdo->query($sql);
- $rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
- $list['pay_num'] = $rowset[0]['pay_serial_number'];
- $list['run_id'] =$order_station['run_id'];
- $list['order_status'] =$order_station['order_status'];
- return $list;
- }
-
|