From ff46a81bdec5d497cea8cc420a15473601ea86c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=8D=8E=E6=B8=85?= <18691022700@163.com> Date: Wed, 17 Sep 2025 22:47:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E5=90=8D=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/model/UserData.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/application/api/model/UserData.php b/application/api/model/UserData.php index 5dc24ac..7f34e8b 100644 --- a/application/api/model/UserData.php +++ b/application/api/model/UserData.php @@ -254,6 +254,11 @@ class UserData extends Model //修改手机号 public function modify_mobile($new_mobile,$user_id) { + //查询新手机号绑定的数量 + $new_mobile_num = db::name('user')->where(['username' => $new_mobile,'status' => ['neq', 0]])->count(); + if ($new_mobile_num >= 3) { + return ['code' => 0, 'msg' => '该手机号已达绑定上限','data' =>null]; + } //查询旧手机号 $mobile = db::name('user')->where(['id' => $user_id])->value('username'); //查询是否实名