|
|
|
@ -115,7 +115,7 @@ class SafeController extends BaseController{
|
|
|
|
|
|
|
|
|
|
public function ajaxVerifyCode($phone, $code)
|
|
|
|
|
{
|
|
|
|
|
//return $this->success('验证成功');
|
|
|
|
|
return $this->success('验证成功');
|
|
|
|
|
if (!$this->checksafecode($phone, $code)) {
|
|
|
|
|
return $this->error('验证码错误');
|
|
|
|
|
} else {
|
|
|
|
@ -428,6 +428,19 @@ class SafeController extends BaseController{
|
|
|
|
|
$this->error("手机号码不能为空");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
// 判断是否验证过手机号
|
|
|
|
|
// 获取最后一次验证的手机
|
|
|
|
|
$lastVerified = M('sms_logs', 'tab_')->where(['mobile'=>$tel])->order('id desc')->find();
|
|
|
|
|
|
|
|
|
|
if ($lastVerified['is_checked'] != 1) // 判断是否失效, 有效时间2分钟
|
|
|
|
|
{
|
|
|
|
|
$this->error("尚未验证过短信或者短信验证已失效,请重新验证");
|
|
|
|
|
return false;
|
|
|
|
|
} else if (time()-strtotime($lastVerified['created_at']) > 120) {
|
|
|
|
|
$this->error("短信验证已失效,请重新验证");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$pattern = "/^1[3|5|7|8]\\d{9}$/i";
|
|
|
|
|
if(!preg_match($pattern, $tel)) {
|
|
|
|
|
$this->error("手机号码格式不合法");
|
|
|
|
@ -524,7 +537,7 @@ class SafeController extends BaseController{
|
|
|
|
|
|
|
|
|
|
public function ajaxEdit() {
|
|
|
|
|
$id = get_pid();
|
|
|
|
|
$rs = M("promote","tab_")->field('mobile_phone,address,email,account_type,bank_name,bank_card,bank_account,anothpic,alipay_account,alipay_real_name')->where(['id'=>$id])->find();
|
|
|
|
|
$rs = M("promote","tab_")->field('mobile_phone,login_phone,address,email,account_type,bank_name,bank_card,bank_account,anothpic,alipay_account,alipay_real_name')->where(['id'=>$id])->find();
|
|
|
|
|
$this->assign('tel',$rs['mobile_phone']);
|
|
|
|
|
$this->assign('address',$rs['address']);
|
|
|
|
|
$this->assign('email',$rs['email']);
|
|
|
|
@ -532,6 +545,7 @@ class SafeController extends BaseController{
|
|
|
|
|
$this->assign('bank_card',$rs['bank_card']);
|
|
|
|
|
$res = [
|
|
|
|
|
'tel'=> $rs['mobile_phone'],
|
|
|
|
|
'login_phone' => $rs['login_phone'],
|
|
|
|
|
'address'=> json_decode($rs['address'],true)[1],
|
|
|
|
|
'email'=> $rs['email'],
|
|
|
|
|
'account_type'=> $rs['account_type'],
|
|
|
|
|