更新细节

This commit is contained in:
yaooo 2023-11-16 09:56:15 +08:00
parent 0fd9d910ca
commit 8a66167310
5 changed files with 13 additions and 13 deletions

View File

@ -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){

View File

@ -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;

View File

@ -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();

View File

@ -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' => '城市编码值错误',

View File

@ -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']);
}
}