diff --git a/IRaCIS.Core.Application/Service/Management/DTO/UserLogViewModel.cs b/IRaCIS.Core.Application/Service/Management/DTO/UserLogViewModel.cs index d500d86fa..0a019d707 100644 --- a/IRaCIS.Core.Application/Service/Management/DTO/UserLogViewModel.cs +++ b/IRaCIS.Core.Application/Service/Management/DTO/UserLogViewModel.cs @@ -56,7 +56,7 @@ namespace IRaCIS.Core.Application.ViewModel public DateTime? EndDate { get; set; } - public UserTypeEnum? LoginUserTypeEnum { get; set; } + public string? LoginUserType { get; set; } public Guid? UserTypeId { get; set; } diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index c5f69c344..b6f53770e 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -941,10 +941,12 @@ namespace IRaCIS.Core.Application.Service { DateTime? trialCreateTime = inQuery.TrialId != null ? _trialRepository.Where(t => t.Id == inQuery.TrialId).Select(t => t.CreateTime).FirstOrDefault() : null; + + var userLogQueryable = _userLogRepository.AsQueryable().IgnoreQueryFilters() - .WhereIf(inQuery.IdentityUserId != null, t => t.ActionIdentityUserId == inQuery.IdentityUserId) - .WhereIf(inQuery.TargetIdentityUserId != null, t => t.TargetIdentityUserId == inQuery.IdentityUserId) + .WhereIf(inQuery.IdentityUserId != null, t => t.ActionIdentityUserId == inQuery.IdentityUserId) + .WhereIf(inQuery.TargetIdentityUserId != null, t => t.TargetIdentityUserId == inQuery.TargetIdentityUserId) .WhereIf(inQuery.TrialId != null, t => t.ActionIdentityUser.UserTrialList.Any(c => c.TrialId == inQuery.TrialId) || t.TargetIdentityUser.UserTrialList.Any(c => c.TrialId == inQuery.TrialId)) .WhereIf(trialCreateTime != null, t => t.CreateTime >= trialCreateTime) .WhereIf(inQuery.OptType != null, t => t.OptType == inQuery.OptType) @@ -954,7 +956,7 @@ namespace IRaCIS.Core.Application.Service .WhereIf(!string.IsNullOrEmpty(inQuery.LoginUserName), t => t.ActionUserName.Contains(inQuery.LoginUserName!)) .WhereIf(!string.IsNullOrEmpty(inQuery.LoginFaildName), t => t.ActionUserName.Contains(inQuery.LoginFaildName!)) .WhereIf(!string.IsNullOrEmpty(inQuery.IP), t => t.IP.Contains(inQuery.IP!)) - .WhereIf(inQuery.LoginUserTypeEnum != null, t => t.CreateUserRole.UserTypeEnum == inQuery.LoginUserTypeEnum) + .WhereIf(!string.IsNullOrEmpty(inQuery.LoginUserType), t => t.ActionUserType == inQuery.LoginUserType) .WhereIf(inQuery.UserTypeId != null, t => t.CreateUserRole.UserTypeId == inQuery.UserTypeId) .ProjectTo(_mapper.ConfigurationProvider);