fix 操作员
This commit is contained in:
@@ -9,6 +9,11 @@ public class UserResponse
|
||||
/// </summary>
|
||||
public string UserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 操作员名称
|
||||
/// </summary>
|
||||
public string OperatorName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 规范化账号名称
|
||||
/// </summary>
|
||||
|
||||
@@ -15,7 +15,7 @@ public class UserService : IUserService
|
||||
{
|
||||
private readonly IDbContext _dbContext;
|
||||
|
||||
public UserService(IDbContext dbContext, IDbContext dbContext1)
|
||||
public UserService(IDbContext dbContext)
|
||||
{
|
||||
_dbContext = dbContext.ChangeDb("identity");
|
||||
}
|
||||
@@ -25,16 +25,18 @@ public class UserService : IUserService
|
||||
return 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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user