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
934 B

  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Redstop
  5. * Date: 2016/8/16
  6. * Time: 11:57
  7. */
  8. header("Content-type:text/html;charset=utf-8");
  9. require_once __DIR__.'/../Common/Mysql.php';
  10. $current_time = date("Y-m-d H:i:s");
  11. $sell_line_array = array(449814,450737,449815);
  12. $sql = " SELECT DISTINCT(parent_order_id) FROM ORDER_MAIN WHERE parent_prod_id IN (".implode(",", $sell_line_array).") AND OUTSIDE_SALE_ORG_ID = 0 ";
  13. $pdo=conn1();
  14. $result=$pdo->query($sql);
  15. if( false == $result) {
  16. exit();
  17. }
  18. $rowset=$result->fetchAll();
  19. if( false == $rowset ) {
  20. exit();
  21. }
  22. $result->closeCursor();
  23. $order_id_array = array();
  24. foreach( $rowset as $row_info ) {
  25. $order_id_array[] = $row_info["parent_order_id"];
  26. }
  27. $update_sql = " UPDATE ORDER_MAIN SET OUTSIDE_SALE_ORG_ID=153 WHERE ORDER_ID IN(".implode(",",$order_id_array).") OR PARENT_ORDER_ID IN (".implode(",",$order_id_array).")";
  28. $pdo2=conn1();
  29. $pdo2->exec($update_sql);