|
- <?php
- //载入配置文件和连接数据库
- date_default_timezone_set('PRC');
- require_once '/usr/share/nginx/ZZWX/ZZDZ/config/Mysql.php';
- require_once '/usr/share/nginx/ZZWX/ZZDZ/application/api/cancel_order.php';
- $pdo=conn();
- $time = date('Y-m-d H:i:s', time()-600);
- $arrr = array(467129);
- //465700 run565794
- foreach ($arrr as $v){
-
- $list_d = Find($v);
- echo $list_d['prod_id'];
- if($list_d['prod_id'] == 449860 ||$list_d['prod_id'] == 449865 ||$list_d['prod_id'] == 449862 ){
- $cancel_order = new cancelOrder();
- $res = $cancel_order -> funCancelOrder($list_d['line_id'], $list_d['run_id'], $list_d['run_bus_order_id'], $list_d['parent_order_id'], $list_d['run_time']);
- var_dump($res);echo 111;
- }
- }
-
-
-
-
-
-
-
- function Find($order_id){
- $pdo= conn();
- $sql = "select order_description,order_price,order_pay_main_id "
- . "from order_main "
- . "where order_id=".$order_id;
- $result=$pdo->query($sql);
- $rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
- $order_price = $rowset[0];//订单总价格 订单票的数量
- $sql = "SELECT DISTINCT
- order_description,parent_order_id,run_date,run_id,run_time,run_bus_order_id,prod_id,parent_prod_id,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_date'].' '.$order_station['run_time'];
- $list['count']='';
- $list['tic_num'] = 0;
- foreach ($array_order_desc as $v){
- $list['count'] .= ' '.$v[0].' × '.$v[2];
- $list['tic_num'] +=$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['line_id'] = $order_station['parent_prod_id'];
- $list['run_id'] = $order_station['run_id'];//run_bus_order_id
- $list['run_bus_order_id'] = $order_station['run_bus_order_id'];//parent_order_id
- $list['parent_order_id'] = $order_station['parent_order_id'];
- $list['prod_id'] = $order_station['prod_id'];
- return $list;
- }
|