|
- <?php
- require_once '../wechat/Common_fx/Mysql.php';
- if (ALLOW_ORIGIN)
- header("Access-Control-Allow-Origin:*");
-
- $pdo=conn();
- //$_POST['iffirst']='';
- //if(isset($_POST['order_id'])){};
- //require_once '../../Common/Mysql.php';
- //$_POST['ifback']=0;
- $back_order_id=0;
- $order_id = isset($_GET['orderno']) ? $_GET['orderno'] : "";
- $ifback = "0";
- $to_order_id=$order_id;
- //$order_id=204351;
- $pdo = conn();
- $sql_s = "select * from to_from where to_orderid=".$order_id." or back_orderid=".$order_id;
- $result=$pdo->query($sql_s);
- $rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
- if($rowset){
- $ifback=1;
- $to_order_id = $rowset[0]['to_orderid'];
- $back_order_id = $rowset[0]['back_orderid'];
-
- $sql = "CALL SP_CANCEL_ORDER(" . 0 . "," . $to_order_id . ")";
- $result = $pdo -> query($sql);
- $sql = "CALL SP_CANCEL_ORDER(" . 0 . "," . $back_order_id . ")";
- $result = $pdo -> query($sql);
- // $return = $result->fetchAll(PDO::FETCH_ASSOC);
- // if(isset($return[0]['@errorcode']) && $return[0]['@errorcode']=='-1'){
- // $code =1;
- // $info = 'fail';
- // $massge = '失败';
- // $list = "";
- // }else{
-
-
-
-
- $code = 0;
- $info = 'success';
- $massge = '成功';
-
- // }
- $result -> closeCursor();
-
- $time_cut = time()-strtotime($list['to']['run_time']); ///时间在开场30分钟前可以退票
- }else{
- //单程情况
-
- $pdo = conn();
- $sql = "CALL SP_CANCEL_ORDER(" . 0 . "," . $order_id . ")";
- $result = $pdo -> query($sql);
- // $return = $result->fetchAll(PDO::FETCH_ASSOC);
- // if(isset($return[0]['@errorcode']) && $return[0]['@errorcode']=='-1'){
- // $code =1;
- // $info = 'fail';
- // $massge = '失败';
- // $list = "";
- // }else{
-
- $code = 0;
- $info = 'success';
- $massge = '订单已取消';
-
- $result -> closeCursor();
-
-
- }
-
-
- echo "支付超时,请重新下单";
- die;
|