fix 操作员

This commit is contained in:
cheche
2024-03-27 14:49:07 +08:00
committed by liguoyang
parent b267fa51be
commit 79763d7f01
2 changed files with 7 additions and 5 deletions

View File

@@ -12,7 +12,7 @@ public class UserResponse
/// <summary>
/// 操作员名称
/// </summary>
public string GainfoName { get; set; }
public string OperatorName { get; set; }
/// <summary>
/// 规范化账号名称

View File

@@ -16,7 +16,7 @@ public class UserService : IUserService
private readonly IDbContext _dbContext;
private readonly IDbContext _dbContext1;
public UserService(IDbContext dbContext, IDbContext dbContext1)
public UserService(IDbContext dbContext)
{
_dbContext = dbContext.ChangeDb("identity");
_dbContext1 = dbContext1;
@@ -27,16 +27,18 @@ public class UserService : IUserService
var page = await _dbContext.Queryable<UserEntity>()
.LeftJoin<UserRoleEntity>((x, ur) => x.Id == ur.UserId)
.LeftJoin<RoleEntity>((x, ur, r) => ur.RoleId == r.Id)
.WhereIF(request.Search.IsPresent(), x => x.UserName.Contains(request.Search)
.LeftJoin<UserClaimEntity>((x, ur, r,c) => x.Id == c.UserId && c.ClaimType == "preferred_username")
.WhereIF(request.Search.IsPresent(), x => x.UserName.Contains(request.Search)
|| x.NormalizedUserName.Contains(request.Search)
|| x.Email.Contains(request.Search)
|| x.NormalizedEmail.Contains(request.Search)
|| x.PhoneNumber.Contains(request.Search)
)
.Select((x, ur, r) => new UserResponse
.Select((x, ur, r,c) => new UserResponse
{
Id = x.Id,
Role = r.Name
Role = r.Name,
OperatorName = c.ClaimValue,
}, true)
.ToPageListAsync(request);