|
- <?php
- /*
- * wechat 2.0
- * Copyright (c) 2016 yixi wei http://zhizhuchuxing.com/
- * Date: 2016.9.02
- * Something is to pay QQ1062140302
- */
- header("Access-Control-Allow-Origin:*");
- date_default_timezone_set('PRC');
- require_once '/usr/share/nginx/XMWX/weixin2/zz_wxsct/Common/Mysql.php';
- $pdo = conn();
- $sql ="select order_id,parent_order_id from order_main where run_date < '". date('Y-m-d', time())."' and parent_order_id>0 and order_status = 146 and order_prod_type in (81,82) ";
- $result=$pdo->query($sql);
- $rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
- $list[]=0;
- $list_p[]=0;
- foreach ($rowset as $v) {
- $list[]=$v['order_id'];
- $list_p[]=$v['parent_order_id'];
- }
- $sql ="select order_id,parent_order_id from order_main where run_date = '". date('Y-m-d', time())."' and run_time<'". date('H:i', time())."' and parent_order_id >0 and order_status = 146 and order_prod_type in (81,82) ";
- $result=$pdo->query($sql);
- $rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
- foreach ($rowset as $v) {
- $list[]=$v['order_id'];
- $list_p[]=$v['parent_order_id'];
- }
- $sql = "update order_main set order_status = 147 where order_id in (".implode($list, ',').") or order_id in(".implode($list_p, ',').")";
- $result=$pdo->query($sql);
- success_notify(implode($list, ','));
- function success_notify($result){
- file_put_contents('./order_status_out_time_update.txt', date("Y-m-d H:i:s")." ".$result.PHP_EOL,FILE_APPEND);//记录所有订单号
- }
|