You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

82 lines
3.7 KiB

  1. <?php
  2. //载入配置文件和连接数据库
  3. date_default_timezone_set('PRC');
  4. require_once '/usr/share/nginx/ZZWX/ZZDZ/config/Mysql.php';
  5. require_once '/usr/share/nginx/ZZWX/ZZDZ/application/api/cancel_order.php';
  6. $pdo=conn();
  7. $time = date('Y-m-d H:i:s', time()-600);
  8. $arrr = array(467129);
  9. //465700 run565794
  10. foreach ($arrr as $v){
  11. $list_d = Find($v);
  12. echo $list_d['prod_id'];
  13. if($list_d['prod_id'] == 449860 ||$list_d['prod_id'] == 449865 ||$list_d['prod_id'] == 449862 ){
  14. $cancel_order = new cancelOrder();
  15. $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']);
  16. var_dump($res);echo 111;
  17. }
  18. }
  19. function Find($order_id){
  20. $pdo= conn();
  21. $sql = "select order_description,order_price,order_pay_main_id "
  22. . "from order_main "
  23. . "where order_id=".$order_id;
  24. $result=$pdo->query($sql);
  25. $rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
  26. $order_price = $rowset[0];//订单总价格 订单票的数量
  27. $sql = "SELECT DISTINCT
  28. 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
  29. FROM `order_main`
  30. where PARENT_ORDER_ID=".$order_id;
  31. $result=$pdo->query($sql);
  32. $rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
  33. $order_station = $rowset[0];//订单来往地址 订单时间 订单好
  34. if(empty($order_station))
  35. return false;
  36. $array_order_desc=array();
  37. $arr_temp = explode('|',$order_price['order_description']);
  38. $arr=array();
  39. foreach ($arr_temp as $k=>$v2) {
  40. if(!empty($v2))
  41. $array_order_desc[]= explode (',', $v2); //订单票 * 数量
  42. }
  43. $list = array();
  44. //上海(黄浦旅游集散站) - 乌镇(西栅1号停车场)//反的数组
  45. $list['station'] = $order_station['PROD_START_STATION_AREA_NAME'].'('.$order_station['PROD_START_STATION_RES_NAME'].')'
  46. .'-'.$order_station['PROD_END_STATION_AREA_NAME'].'('.$order_station['PROD_END_STATION_RES_NAME'].')';
  47. $list['start_station']=$order_station['PROD_START_STATION_AREA_NAME'];
  48. $list['end_station']=$order_station['PROD_END_STATION_AREA_NAME'];
  49. $list['start_res_name'] = $order_station['PROD_START_STATION_RES_NAME'];
  50. $list['end_res_name'] = $order_station['PROD_END_STATION_RES_NAME'];
  51. $list['run_date'] = $order_station['run_date'];
  52. $list['run_time'] = $order_station['run_date'].' '.$order_station['run_time'];
  53. $list['count']='';
  54. $list['tic_num'] = 0;
  55. foreach ($array_order_desc as $v){
  56. $list['count'] .= ' '.$v[0].' × '.$v[2];
  57. $list['tic_num'] +=$v[2] ;
  58. }
  59. $list['order_price'] = $order_price['order_price'];
  60. $sql = "select pay_serial_number from order_pay_detail where pay_main_id =".$order_price['order_pay_main_id'];
  61. $result=$pdo->query($sql);
  62. $rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
  63. $list['pay_num'] = $rowset[0]['pay_serial_number'];
  64. $list['line_id'] = $order_station['parent_prod_id'];
  65. $list['run_id'] = $order_station['run_id'];//run_bus_order_id
  66. $list['run_bus_order_id'] = $order_station['run_bus_order_id'];//parent_order_id
  67. $list['parent_order_id'] = $order_station['parent_order_id'];
  68. $list['prod_id'] = $order_station['prod_id'];
  69. return $list;
  70. }