From 341c93da80267919ed5b6bc83b1131574542e8ae 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, 15 Aug 2025 14:11:31 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=91=E5=AE=9A=E6=9B=B4=E6=8D=A2=E6=89=8B?= =?UTF-8?q?=E6=9C=BA=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/model/Sms.php | 4 ++-- application/api/model/UserData.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/application/api/model/Sms.php b/application/api/model/Sms.php index 29962bc..82a9ae1 100644 --- a/application/api/model/Sms.php +++ b/application/api/model/Sms.php @@ -26,8 +26,8 @@ class Sms extends Model if($type == 1 || $type == 2){ //查询手机号绑定的数量 $map = []; - $map[] = ['mobile', '=', $mobile]; - $map[] = ['status', '=', 1]; + $map['mobile'] = $mobile; + $map['status'] = 1; $user_info = db::name('user')->where($map)->count(); if($user_info >= 4){ return ['code' => 0, 'msg' => '该手机号已达绑定上线','data' =>null]; diff --git a/application/api/model/UserData.php b/application/api/model/UserData.php index 534e05b..5b60a02 100644 --- a/application/api/model/UserData.php +++ b/application/api/model/UserData.php @@ -252,7 +252,7 @@ class UserData extends Model public function modify_mobile($new_mobile,$user_id) { //查询旧手机号 - $mobile = db::name('user')->where(['id' => $user_id])->value('user_name'); + $mobile = db::name('user')->where(['id' => $user_id])->value('username'); //查询是否实名 $is_real = db::name('user_auth')->where(['mobile' => $mobile,'is_real' => 1])->find(); if($is_real){ @@ -260,7 +260,7 @@ class UserData extends Model db::startTrans(); //修改实名手机号 $red = db::name('user_auth')->where(['id' => $is_real['id']])->update(['mobile' => $new_mobile]); - $reslut = db::name('user')->where(['id' => $user_id])->update(['user_name' => $new_mobile]); + $reslut = db::name('user')->where(['id' => $user_id])->update(['username' => $new_mobile]); if ($reslut && $red) { Db::commit(); return ['code' => 1, 'msg' => '修改成功','data' =>null]; @@ -269,7 +269,7 @@ class UserData extends Model return ['code' => 0, 'msg' => '修改失败','data' =>null]; } }else{ - $reslut = db::name('user')->where(['id' => $user_id])->update(['user_name' => $new_mobile]); + $reslut = db::name('user')->where(['id' => $user_id])->update(['username' => $new_mobile]); if ($reslut) { return ['code' => 1, 'msg' => '修改成功','data' =>null]; }