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.
 
 
 
 

42 lines
1.3 KiB

  1. <?php
  2. header("Access-Control-Allow-Origin:*");
  3. //载入配置文件和连接数据库
  4. date_default_timezone_set('PRC');
  5. require_once '../Common/Mysql.php';
  6. $pdo=conn();
  7. $time = date('Y-m-d H:i:s', time()-600);
  8. $sql="select order_id,create_time from order_main where create_time<'".$time."' and order_status = 145 and cancel_flag=0 and parent_order_id =0 and ORDER_BOOK_STATUS =1 and order_prod_type in (81,82)";
  9. $result=$pdo->query($sql);
  10. $rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
  11. foreach ($rowset as $v) {
  12. $list[] =$v['order_id'];
  13. }
  14. foreach ($list as $v) {
  15. $sql = "CALL SP_CANCEL_ORDER(" . 0 . "," . $v . ")";
  16. $result = $pdo -> query($sql);
  17. }
  18. $pdo=conn1();
  19. $time = date('Y-m-d H:i:s', time()-600);
  20. $sql="select order_id,create_time from order_main where create_time<'".$time."' and order_status = 145 and cancel_flag=0 and parent_order_id =0 and ORDER_BOOK_STATUS =1 and order_prod_type in (81,82)";
  21. $result=$pdo->query($sql);
  22. $rowset = $result -> fetchAll(PDO::FETCH_ASSOC);
  23. foreach ($rowset as $v) {
  24. $list[] =$v['order_id'];
  25. }
  26. foreach ($list as $v) {
  27. $sql = "CALL SP_CANCEL_ORDER(" . 0 . "," . $v . ")";
  28. $result = $pdo -> query($sql);
  29. }