From eb76e324e911d7d0b636af6767484fbfce595c68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=8D=8E=E6=B8=85?= <18691022700@163.com> Date: Fri, 19 Dec 2025 15:45:27 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9F=AD=E4=BF=A1=E9=AA=8C=E8=AF=81=E7=A0=81?= =?UTF-8?q?=20=E6=A0=A1=E9=AA=8C=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/model/Sms.php | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/application/api/model/Sms.php b/application/api/model/Sms.php index 0e667e34..b3c9e9a8 100644 --- a/application/api/model/Sms.php +++ b/application/api/model/Sms.php @@ -42,20 +42,9 @@ class Sms extends Model return ['code' => 0, 'msg' => '验证码错误次数过多,账号已被封禁,请联系管理员处理','data' =>null]; } - $is_code = db::name('sms')->where(['mobile' => $mobile, 'event' => $type])->order('id desc')->find(); + $is_code = db::name('sms')->where(['mobile' => $mobile, 'event' => $type,'deletetime' => 0])->order('id desc')->find(); if ($is_code && $is_code['code'] == $code) { - //验证码正确 - if($type == 1 || $type == 2){ - //查询手机号绑定的数量 - $map = []; - $map['mobile'] = $mobile; - $map['status'] = 1; - $user_info = db::name('user')->where($map)->count(); - if($user_info >= 4){ - return ['code' => 0, 'msg' => '该手机号已达绑定上线','data' =>null]; - } - } - db::name('sms')->where(['mobile' => $mobile, 'event' => $type])->delete(); + db::name('sms')->where(['mobile' => $mobile, 'event' => $type])->update(['deletetime' => time()]); //登陆成功后 把所有的登录错误删除掉 db::name('sms_error')->where(['mobile' => $mobile])->delete(); return ['code' =>1, 'msg' =>'验证码正确','data' =>null];