本文整理匯總了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'));
}
}