本文整理汇总了PHP中Sms::execResult方法的典型用法代码示例。如果您正苦于以下问题:PHP Sms::execResult方法的具体用法?PHP Sms::execResult怎么用?PHP Sms::execResult使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sms
的用法示例。
在下文中一共展示了Sms::execResult方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendSms
public function sendSms($params = array())
{
//extract($params);
$type = $params['type'];
$mobile = $params['mobile'];
if (isset($type) && isset($mobile)) {
// $type =='register','forget',
$num = $this->getrandstr();
$cache = Yii::app()->cache;
$cache->hset($mobile, $type, $num);
$sms = new Sms();
$result = $sms->send($mobile, '【Urtime】您的注册验证码是:' . $num . '.请完成注册', true);
$res = $sms->execResult($result);
if ($res[1] == 0) {
// echo '发送成功';
$ret = $this->notice('OK', 0, '', $result);
} else {
//echo "发送失败{$result[1]}";
$ret = $this->notice('ERR', 307, '', $result);
}
} else {
$ret = $this->notice('ERR', 301, '', array('mobile' => isset($mobile) ? $mobile : 0, 'type' => isset($type) ? $type : ''));
}
return $ret;
}
示例2: actionDelete
public function actionDelete()
{
$id = $this->_get('id');
$user_id = $this->_get('user_id');
$obj = User::model()->findByPk($user_id);
if ($id && Report::model()->deleteByPk($id)) {
$mobile = $obj->mobile;
if (isset($mobile) && $mobile) {
// $type =='register','forget',
$sms = new Sms();
$result = $sms->sendSMS($mobile, '您好,你的反馈我们已近收到,我们将尽快处理,Urtime谢谢你的宝贵意见', 'true');
$result = $sms->execResult($result);
if ($result[1] == 0) {
// echo '发送成功';
Yii::app()->user->setFlash('send', 1);
$this->redirect(array('report/index'));
} else {
//echo "发送失败{$result[1]}";
Yii::app()->user->setFlash('send', 0);
$this->redirect(array('report/index'));
}
} else {
Yii::app()->user->setFlash('report', 0);
$this->redirect(array('report/index'));
}
} else {
Yii::app()->user->setFlash('report', 0);
$this->redirect(array('report/index'));
}
}