public function captchaforgetpwd_get() { $this->load->library('kqsms'); $mobile = $this->get('mobile'); $captcha = random_number(); // $response = $this->kqsms->mock_send_forgetpwd_sms($mobile,$captcha); $response = $this->kqsms->send_forgetpwd_sms($mobile, $captcha); $xml = simplexml_load_string($response); $code = $xml->code; $query = $this->db->query("insert into s_sms (type,code,mobile) values ('forget',{$code},{$mobile})"); if ($code == 2) { // echo 'success'; $captchaMd5 = md5($captcha); return $this->output_results(array('captcha' => $captchaMd5)); } else { // echo 'failure'; return $this->output_error(ErrorFailureSMS); } }
public function test_send_notification($uid, $couponId) { $user = $this->user->get($uid); $completeTitle = $this->coupon->get_complete_title($couponId); // var_dump($user); $mobile = $user['username']; $device = $user['device']; if ($device == 'iOS') { // echo 'iOS'; $sms = new Kqsms(); $response = $sms->send_coupon_accepted_sms($mobile, $completeTitle); echo $response; } else { // echo 'Android'; $umengpush = new UmengPush(); $title = '优惠券承兑完成'; $text = "您的" . $completeTitle . "快券已使用,更多优惠在等着你哦!"; $umengpush->send_customized_notification($uid, $title, $text); } }
function test_bind_card_sms() { header('Content-Type:text/html;charset=utf-8 '); $this->load->library('kqsms'); echo $this->kqsms->send_bind_card_sms('13166361023', '99999999'); }