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.
 
 
 
 

47 lines
1.5 KiB

  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Qiu Song
  5. * Date: 2016/11/07
  6. * Time: 15:00
  7. */
  8. header("Content-type:text/html;charset=utf-8");
  9. require_once __DIR__.'/../Common/Mysql.php';
  10. date_default_timezone_set('Asia/Shanghai');
  11. $current_time = date("Y-m-d H:i:s");
  12. $pdo=conn();
  13. $sql = " SELECT id,order_id,send_flag,send_mobile,send_message ".
  14. " FROM send_bus_success_message ".
  15. " WHERE send_flag = 0 ";
  16. $result=$pdo->query($sql);
  17. if( false == $result ) {
  18. echo "success";
  19. exit();
  20. }
  21. $rowset=$result->fetchAll();
  22. $result->closeCursor();
  23. if( false == $rowset ) {
  24. echo "success";
  25. exit();
  26. }
  27. $userid = 2;
  28. foreach( $rowset as $row_info ) {
  29. $send_success="-100";
  30. $response = sendTelMessage($row_info['send_mobile'], "", $row_info['send_message'], $row_info['order_id']);
  31. if($response!=null){
  32. $send_success=(int)$response;
  33. }
  34. $sql1 = "insert into order_send_message(ORDER_ID,SEND_MOBILE,SEND_MESSAGE,SEND_TIME,SEND_ERROR,CREATE_USER_ID,CREATE_TIME,UPDATE_USER_ID,UPDATE_TIME) VALUES ({$row_info['order_id']},'{$row_info['send_mobile']}', '{$row_info['send_message']}','{$current_time}', 0, {$userid},'{$current_time}', {$userid},'{$current_time}' )";
  35. echo $sql1."<hr />";
  36. $pdo_cancel = conn();
  37. $pdo_cancel->exec( $sql1 );
  38. $update_sql = " UPDATE send_bus_success_message SET send_flag = 1, send_success_time='{$current_time}' WHERE id = {$row_info['id']} ";
  39. $pdo_cancel2 = conn();
  40. $pdo_cancel->exec( $update_sql );
  41. }
  42. exit();