From 8a661673109dac8481335f9565e145390c43f8aa Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Thu, 16 Nov 2023 09:56:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/adminapi/lists/user/UserLists.php | 4 ++-- app/adminapi/logic/user/UserLogic.php | 2 +- app/api/logic/LoginLogic.php | 6 +++--- app/common/validate/login/RegisterValidate.php | 6 +++--- app/common/validate/user/UserValidate.php | 8 ++++---- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/adminapi/lists/user/UserLists.php b/app/adminapi/lists/user/UserLists.php index e509b0ed..584334a2 100644 --- a/app/adminapi/lists/user/UserLists.php +++ b/app/adminapi/lists/user/UserLists.php @@ -13,14 +13,14 @@ class UserLists extends BaseAdminDataLists implements ListsSearchInterface { return [ '=' => ['status','province','city','area','street','village','brigade'], - '%like%' => ['nick_name','real_name','phone'], + '%like%' => ['nickname','realname','phone'], ]; } // 获取用户列表 public function lists(): array { - $field = "id,phone,avatar,nick_name,real_name,id_card,gender,age,total_balance,total_integral,province,city,area,street,village,brigade,address,status,create_time"; + $field = "id,phone,avatar,nickname,realname,id_card,gender,age,total_balance,total_integral,province,city,area,street,village,brigade,address,status,create_time"; return User::field($field)->where('status','<>',2)->where($this->searchWhere) ->limit($this->limitOffset, $this->limitLength)->order('id desc') ->select()->each(function($item){ diff --git a/app/adminapi/logic/user/UserLogic.php b/app/adminapi/logic/user/UserLogic.php index 6b1874bc..24e58e14 100644 --- a/app/adminapi/logic/user/UserLogic.php +++ b/app/adminapi/logic/user/UserLogic.php @@ -14,7 +14,7 @@ class UserLogic extends BaseLogic public static function detail(int $userId): array { //获取用户信息 - $field = ['id','phone','avatar','nick_name','real_name','id_card','gender','age','total_balance','total_integral','province','city','area','street','village','brigade','address','status','last_login_time','last_login_ip','create_time']; + $field = ['id','phone','avatar','nickname','realname','id_card','gender','age','total_balance','total_integral','province','city','area','street','village','brigade','address','status','last_login_time','last_login_ip','create_time']; $user = User::field($field)->where(['id' => $userId])->findOrEmpty(); $user['address'] = $user->province_text.$user->city_text.$user->area_text.$user->street_text.$user->village_text.$user->brigade_text.$user->address; $user['gender_text'] = $user->gender_text; diff --git a/app/api/logic/LoginLogic.php b/app/api/logic/LoginLogic.php index 1cc2ae7e..fc7d5480 100644 --- a/app/api/logic/LoginLogic.php +++ b/app/api/logic/LoginLogic.php @@ -33,12 +33,12 @@ class LoginLogic extends BaseLogic $user = User::create([ 'admin_id' => 0, 'phone' => $params['phone'], - 'nick_name' => '用户'.$params['phone'], + 'nickname' => '用户'.$params['phone'], 'password' => $userPassword, 'avatar' => empty($params['avatar']) ? $avatar : $params['avatar'], 'age' => empty($params['age']) ? 0 : $params['age'], 'gender' => empty($params['gender']) ? 0 : $params['gender'], - 'real_name' => empty($params['real_name']) ? '' : $params['real_name'], + 'realname' => empty($params['realname']) ? '' : $params['realname'], 'id_card' => empty($params['id_card']) ? '' : $params['id_card'], 'province' => empty($params['province']) ? 0 : $params['province'], 'city' => empty($params['city']) ? 0 : $params['city'], @@ -93,7 +93,7 @@ class LoginLogic extends BaseLogic { try { $where = ['phone' => $params['account']]; - $user = User::field(['id', 'phone', 'avatar', 'nick_name'])->where($where)->findOrEmpty(); + $user = User::field(['id', 'phone', 'avatar', 'nickname'])->where($where)->findOrEmpty(); //更新登录信息 $user->last_login_time = time(); $user->last_login_ip = request()->ip(); diff --git a/app/common/validate/login/RegisterValidate.php b/app/common/validate/login/RegisterValidate.php index 195cb7ea..b16489fd 100644 --- a/app/common/validate/login/RegisterValidate.php +++ b/app/common/validate/login/RegisterValidate.php @@ -24,7 +24,7 @@ class RegisterValidate extends BaseValidate 'password' => 'require|length:6,20', 'age' => 'number|gt:0', 'gender' => 'in:0,1,2', - 'real_name' => 'chs|length:2,25', + 'realname' => 'chs|length:2,25', 'id_card' => 'idCard', 'province' => 'number', 'city' => 'number', @@ -44,8 +44,8 @@ class RegisterValidate extends BaseValidate 'age.number' => '年龄必须是数字', 'age.gt' => '年龄必须大于0', 'gender.in' => '用户性别值错误', - 'real_name.chs' => '真实姓名必须是汉字', - 'real_name.length' => '真实姓名长度必须大于2个汉字且不得超过25个汉字', + 'realname.chs' => '真实姓名必须是汉字', + 'realname.length' => '真实姓名长度必须大于2个汉字且不得超过25个汉字', 'id_card.idCard' => '身份证号码不正确', 'province.number' => '省份编码值错误', 'city.number' => '城市编码值错误', diff --git a/app/common/validate/user/UserValidate.php b/app/common/validate/user/UserValidate.php index 88b78a76..5d22efea 100644 --- a/app/common/validate/user/UserValidate.php +++ b/app/common/validate/user/UserValidate.php @@ -14,7 +14,7 @@ class UserValidate extends BaseValidate 'code' => 'require', 'age' => 'number|gt:0', 'gender' => 'in:0,1,2', - 'real_name' => 'chs|length:2,25', + 'realname' => 'chs|length:2,25', 'id_card' => 'idCard', 'province' => 'number', 'city' => 'number', @@ -33,8 +33,8 @@ class UserValidate extends BaseValidate 'age.number' => '年龄必须是数字', 'age.gt' => '年龄必须大于0', 'gender.in' => '用户性别值错误', - 'real_name.chs' => '真实姓名必须是汉字', - 'real_name.length' => '真实姓名长度必须大于2个汉字且不得超过25个汉字', + 'realname.chs' => '真实姓名必须是汉字', + 'realname.length' => '真实姓名长度必须大于2个汉字且不得超过25个汉字', 'id_card.idCard' => '身份证号码不正确', 'province.number' => '省份编码值错误', 'city.number' => '城市编码值错误', @@ -56,6 +56,6 @@ class UserValidate extends BaseValidate public function sceneEdit(): UserValidate { - return $this->only(['age','gender','real_name','id_card','province','city','area','street','village','brigade','address']); + return $this->only(['age','gender','realname','id_card','province','city','area','street','village','brigade','address']); } } \ No newline at end of file