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.
 
 
 
 
 

34 lines
1.4 KiB

  1. <?php
  2. /*
  3. * wechat 2.0
  4. * Copyright (c) 2016 yixi wei http://zhizhuchuxing.com/
  5. * Date: 2016.9.02
  6. * Something is to pay QQ1062140302
  7. */
  8. header("Access-Control-Allow-Origin:*");
  9. date_default_timezone_set('PRC');
  10. require_once '/usr/share/nginx/XMWX/weixin2/zz_wxsct/Common/Mysql.php';
  11. $pdo = conn();
  12. $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) ";
  13. $result=$pdo->query($sql);
  14. $rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
  15. $list[]=0;
  16. $list_p[]=0;
  17. foreach ($rowset as $v) {
  18. $list[]=$v['order_id'];
  19. $list_p[]=$v['parent_order_id'];
  20. }
  21. $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) ";
  22. $result=$pdo->query($sql);
  23. $rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
  24. foreach ($rowset as $v) {
  25. $list[]=$v['order_id'];
  26. $list_p[]=$v['parent_order_id'];
  27. }
  28. $sql = "update order_main set order_status = 147 where order_id in (".implode($list, ',').") or order_id in(".implode($list_p, ',').")";
  29. $result=$pdo->query($sql);
  30. success_notify(implode($list, ','));
  31. function success_notify($result){
  32. file_put_contents('./order_status_out_time_update.txt', date("Y-m-d H:i:s")." ".$result.PHP_EOL,FILE_APPEND);//记录所有订单号
  33. }