|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- /**
- * Created by PhpStorm.
- * User: Qiu Song
- * Date: 2016/11/07
- * Time: 15:00
- */
- header("Content-type:text/html;charset=utf-8");
- require_once __DIR__.'/../Common/Mysql.php';
- date_default_timezone_set('Asia/Shanghai');
-
- $current_time = date("Y-m-d H:i:s");
-
- $pdo=conn();
- $sql = " SELECT id,order_id,send_flag,send_mobile,send_message ".
- " FROM send_bus_success_message ".
- " WHERE send_flag = 0 ";
- $result=$pdo->query($sql);
- if( false == $result ) {
- echo "success";
- exit();
- }
- $rowset=$result->fetchAll();
- $result->closeCursor();
- if( false == $rowset ) {
- echo "success";
- exit();
- }
- $userid = 2;
- foreach( $rowset as $row_info ) {
- $send_success="-100";
- $response = sendTelMessage($row_info['send_mobile'], "", $row_info['send_message'], $row_info['order_id']);
- if($response!=null){
- $send_success=(int)$response;
- }
- $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}' )";
- echo $sql1."<hr />";
- $pdo_cancel = conn();
- $pdo_cancel->exec( $sql1 );
- $update_sql = " UPDATE send_bus_success_message SET send_flag = 1, send_success_time='{$current_time}' WHERE id = {$row_info['id']} ";
- $pdo_cancel2 = conn();
- $pdo_cancel->exec( $update_sql );
- }
-
- exit();
-
|