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.
 
 
 
 
 

73 lines
2.1 KiB

  1. <?php
  2. require_once '../wechat/Common_fx/Mysql.php';
  3. if (ALLOW_ORIGIN)
  4. header("Access-Control-Allow-Origin:*");
  5. $pdo=conn();
  6. //$_POST['iffirst']='';
  7. //if(isset($_POST['order_id'])){};
  8. //require_once '../../Common/Mysql.php';
  9. //$_POST['ifback']=0;
  10. $back_order_id=0;
  11. $order_id = isset($_GET['orderno']) ? $_GET['orderno'] : "";
  12. $ifback = "0";
  13. $to_order_id=$order_id;
  14. //$order_id=204351;
  15. $pdo = conn();
  16. $sql_s = "select * from to_from where to_orderid=".$order_id." or back_orderid=".$order_id;
  17. $result=$pdo->query($sql_s);
  18. $rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
  19. if($rowset){
  20. $ifback=1;
  21. $to_order_id = $rowset[0]['to_orderid'];
  22. $back_order_id = $rowset[0]['back_orderid'];
  23. $sql = "CALL SP_CANCEL_ORDER(" . 0 . "," . $to_order_id . ")";
  24. $result = $pdo -> query($sql);
  25. $sql = "CALL SP_CANCEL_ORDER(" . 0 . "," . $back_order_id . ")";
  26. $result = $pdo -> query($sql);
  27. // $return = $result->fetchAll(PDO::FETCH_ASSOC);
  28. // if(isset($return[0]['@errorcode']) && $return[0]['@errorcode']=='-1'){
  29. // $code =1;
  30. // $info = 'fail';
  31. // $massge = '失败';
  32. // $list = "";
  33. // }else{
  34. $code = 0;
  35. $info = 'success';
  36. $massge = '成功';
  37. // }
  38. $result -> closeCursor();
  39. $time_cut = time()-strtotime($list['to']['run_time']); ///时间在开场30分钟前可以退票
  40. }else{
  41. //单程情况
  42. $pdo = conn();
  43. $sql = "CALL SP_CANCEL_ORDER(" . 0 . "," . $order_id . ")";
  44. $result = $pdo -> query($sql);
  45. // $return = $result->fetchAll(PDO::FETCH_ASSOC);
  46. // if(isset($return[0]['@errorcode']) && $return[0]['@errorcode']=='-1'){
  47. // $code =1;
  48. // $info = 'fail';
  49. // $massge = '失败';
  50. // $list = "";
  51. // }else{
  52. $code = 0;
  53. $info = 'success';
  54. $massge = '订单已取消';
  55. $result -> closeCursor();
  56. }
  57. echo "支付超时,请重新下单";
  58. die;