|
@@ -6,8 +6,8 @@
|
|
|
*/
|
|
|
|
|
|
require_once('class.mysql.php');
|
|
|
-require_once('/www/wwwroot/edm.alipearl.net/frame/alisms.php');
|
|
|
-//require_once('../frame/alisms.php');
|
|
|
+require_once ('/www/wwwroot/edm.alipearl.net/frame/common.php');
|
|
|
+//require_once('../frame/common.php');
|
|
|
set_time_limit(1800);
|
|
|
$dbms = 'mysql';
|
|
|
$host = 'localhost';
|
|
@@ -15,30 +15,28 @@ $DB_Database = $dbName = 'edm_alipearl_net';
|
|
|
$user = 'edm_alipearl_net';
|
|
|
$pass = '6fP8Pf6dLdmFBYR4';
|
|
|
$db_charset = "utf8";
|
|
|
-
|
|
|
$db = new Daopdo($host, $user, $pass, $dbName, $db_charset);
|
|
|
-
|
|
|
-$sql['email_data'] = 'SELECT `id`,`params_json` FROM `ly_sms_data_tmp` ORDER BY `id` ASC LIMIT 1;';
|
|
|
-
|
|
|
+$sql['email_data'] = 'SELECT `id`,`params_json` FROM `ly_sms_data_tmp_new` ORDER BY `id` ASC LIMIT 1;';
|
|
|
$email_data = $db->query($sql['email_data'], 'Row');
|
|
|
if (empty($email_data)) {
|
|
|
exit(0);
|
|
|
} else {
|
|
|
- $sql['delQueueHead'] = "DELETE FROM `ly_sms_data_tmp` WHERE `id`='{$email_data['id']}';";
|
|
|
+ $sql['delQueueHead'] = "DELETE FROM `ly_sms_data_tmp_new` WHERE `id`='{$email_data['id']}';";
|
|
|
$db->query($sql['delQueueHead']);
|
|
|
}
|
|
|
$params = unserialize($email_data['params_json']);
|
|
|
-$mobiles =$params['to'];
|
|
|
-foreach ($mobiles as $k=>$v){
|
|
|
- $mobile = $v['mobile'];
|
|
|
- $from = $v['from_name'];
|
|
|
- sendSmsali($mobile,$params['template_body'],$from);
|
|
|
- $times=date('Y-m-d H:i:s',time());
|
|
|
- $sql['insert_log'] = 'INSERT INTO `ly_send_sms_log` (`mobile`,`addtime`,`template_id`,`template_body`,`from_name`,`uid`) VALUES ';
|
|
|
- $sql['insert_log'] .= "('{$mobile}','{$times}','{$params['template_id']}','{$params['template_body']}','{$from}','{$params['uid']}');";
|
|
|
- $insert_log = $db->query($sql['insert_log']);
|
|
|
-}
|
|
|
-echo 'success';
|
|
|
+$uid = $params['uid'];
|
|
|
+$phone=serialize($params['phone']);
|
|
|
+$params['phone'] = implode(',', $params['phone']);
|
|
|
+unset($params['uid']);
|
|
|
+//$params= http_build_query($params);
|
|
|
+$post_url = 'http://api2.nxcloud.com/api/sms/mtsend';
|
|
|
+$result = make_curl($post_url, $params);
|
|
|
+$params['status'] = $result['code'];
|
|
|
+$params['remarks'] = $result['messageid'];
|
|
|
+$sql['insert_log'] = 'INSERT INTO `ly_send_sms_log_new` (`mobile`,`template_body`,`from_name`,`uid`,`status`,`remarks`) VALUES ';
|
|
|
+$sql['insert_log'] .= "('{$phone}','{$params['content']}','{$params['source_address']}','{$uid}','{$params['status']}','{$params['remarks']}');";
|
|
|
+$insert_log = $db->query($sql['insert_log']);
|
|
|
|
|
|
|
|
|
|