|
- <?php
- /*
- * wechat 2.0
- * Copyright (c) 2016 yixi wei http://zhizhuchuxing.com/
- * Date: 2016.09.06
- * Something is to pay QQ1062140302
- */
-
- header("Access-Control-Allow-Origin:*");
- //载入配置文件和连接数据库
- date_default_timezone_set('PRC');
- require_once '/usr/share/nginx/ZZFX/wchat_fx/zz-fx/Common/Mysql.php';
- $pdo = conn();
- $sql = "SELECT * from disney_order where cancel_flag = 0 and yet = 0;";
- $result = $pdo->query($sql);
- $rowset = $result->fetchAll(PDO::FETCH_ASSOC);
-
- $list_tic = get_memcache('disney_ticket_info');
- $list_tic2 = get_memcache('lion_threater_info');
-
- if (isset($rowset[0]['order_id'])) {
- foreach ($rowset as $v) {
- $pdo2 = conn();
- $sql2 = "SELECT ORDER_ID FROM order_main WHERE ORDER_ID = ".$v['order_id'];
- $result2 = $pdo2->query($sql);
- $rowset2 = false;
- if( $result2 != false ) {
- $rowset2 = $result2->fetchAll(PDO::FETCH_ASSOC);
- $result2->closeCursor();
- }
- if( $rowset2 == false) {
- $sql = "update `disney_order` set cancel_flag=2 where order_id =" . $v['order_id'];
- $result = $pdo->query($sql);
- continue;
- }
- if ($v['dis_the'] == 1) {
- $tic_info = $mem_theater_array[$v['date']][$v['time']];
- $trade_no = buy_lionking_ticket($v['cust_name'], $v['cust_phone'], $v['customer_id'], unserialize($v['ticket_no']), $v['date'], $v['time'], $tic_info["ticket_array"]);
- } else {
- $disney_all_array = $list_tic[$v['date']]["ticket_array"];
- $trade_no = buy_disney_ticket($v['cust_name'], $v['cust_phone'], $v['customer_id'], unserialize($v['ticket_no']), $v['date'],$disney_all_array);
- }
- if( $trade_no == 0 || $trade_no == -1 ) {
- continue;
- }
- if ($no = true_buy_disney($trade_no)) {
- $sql = "update `disney_order` set cancel_flag =" . $no . " where order_id =" . $v['order_id'];
- $result = $pdo->query($sql);
- }
- }
- }
- die;
|