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']}';"; $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';