本文整理匯總了PHP中Func::sendSMS方法的典型用法代碼示例。如果您正苦於以下問題:PHP Func::sendSMS方法的具體用法?PHP Func::sendSMS怎麽用?PHP Func::sendSMS使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Func
的用法示例。
在下文中一共展示了Func::sendSMS方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: sendSmsAction
/**
* 發送短息
*/
public function sendSmsAction()
{
$vars = ['pho_phone', 'sign'];
$data = $this->beforeGetVarExecVerify($vars);
//驗證碼
$pho_code = mt_rand(100000, 999999);
//記錄驗證碼
$add_status = (new \Member())->addPhoneLog($data['pho_phone'], $pho_code);
if ($add_status != OK) {
$this->throwMessage($add_status);
}
//發送驗證碼
$send_status = \Func::sendSMS($data['pho_phone'], $pho_code);
if ($send_status != OK) {
$this->throwMessage($send_status);
}
$this->throwMessage(OK, ['pho_code' => $pho_code]);
}
示例2: sendSmsAction
/**
* 發送短息
*/
public function sendSmsAction()
{
$vars = ['pho_phone', 'sign'];
//獲取數據
list($pho_phone, $sign) = \Verify::getQuery($vars);
//驗證參數
if (\Verify::getMessage()) {
$this->throwMessage(PARAMETER_FAIL, \Verify::getMessage());
}
//驗證簽名
if (!$this->verifySign($pho_phone, $sign)) {
$this->throwMessage(ILLEGAL_SIGN);
}
//發送驗證碼
$pho_code = mt_rand(100000, 999999);
$send_status = \Func::sendSMS($pho_phone, $pho_code);
if ($send_status != OK) {
$this->throwMessage($send_status);
}
//記錄驗證碼
$this->throwMessage((new \Member())->addPhoneLog($pho_phone, $pho_code), ['pho_code' => $pho_code]);
}