public function isValidRegCode($code, $phone)
{
/* # 安全过滤 */
$code = intval($code);
$phone = floatval($phone);
/* # 验证手机号码是否为空 */
if (!$phone) {
$this->_error = '手机号不能为空';
return false;
/* # 验证验证码是否为空 */
} elseif (!$code) {
$this->_error = '验证码不能为空';
return false;
/* # 验证验证码是否错误 */
} elseif ($sms = model('Sms') and !$sms->CheckCaptcha($phone, $code)) {
$this->_error = $sms->getMessage();
unset($sms);
return false;
}
return true;
}