fix 操作员
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user