From 32d6ebef9cc0a692be2dd30b6e189f44b1e0d900 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 14 May 2024 10:25:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E5=BF=97=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Management/DTO/UserLogViewModel.cs | 6 +++--- IRaCIS.Core.Application/Service/Management/UserService.cs | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Management/DTO/UserLogViewModel.cs b/IRaCIS.Core.Application/Service/Management/DTO/UserLogViewModel.cs index 909f42ff8..71f6de8ea 100644 --- a/IRaCIS.Core.Application/Service/Management/DTO/UserLogViewModel.cs +++ b/IRaCIS.Core.Application/Service/Management/DTO/UserLogViewModel.cs @@ -47,13 +47,13 @@ namespace IRaCIS.Core.Application.ViewModel public string? LoginFaildName { get; set; } + public string? LoginUserName { get; set; } + public DateTime? BeginDate { get; set; } public DateTime? EndDate { get; set; } - public string? LoginUserName { get; set; } - - public UserTypeEnum? LoginUserTypeEnum { 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 11fd56dd9..e73b2798b 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -759,14 +759,15 @@ namespace IRaCIS.Application.Services var userLogQueryable = _userLogRepository - .WhereIf(inQuery.TrialId != null, t => t.LoginUser.UserTrials.Any(c => c.TrialId == inQuery.TrialId && c.UserId == t.LoginUserId)) + .WhereIf(inQuery.TrialId != null, t => t.LoginUser.UserTrials.Any(c => c.TrialId == inQuery.TrialId && (c.UserId == t.LoginUserId || c.UserId == t.OptUserId))) .WhereIf(inQuery.OptType != null, t => t.OptType == inQuery.OptType) .WhereIf(inQuery.BeginDate != null, t => t.CreateTime >= inQuery.BeginDate) .WhereIf(inQuery.EndDate != null, t => t.CreateTime <= inQuery.EndDate) - .WhereIf(inQuery.LoginUserTypeEnum != null, t => t.LoginUser.UserTypeEnum== inQuery.LoginUserTypeEnum) .WhereIf(!string.IsNullOrEmpty(inQuery.LoginUserName), t => t.LoginUser.UserName.Contains(inQuery.LoginUserName!)) .WhereIf(!string.IsNullOrEmpty(inQuery.LoginFaildName), t => t.LoginFaildName.Contains(inQuery.LoginFaildName!)) .WhereIf(!string.IsNullOrEmpty(inQuery.IP), t => t.IP.Contains(inQuery.IP!)) + .WhereIf(inQuery.UserTypeId != null, t => t.LoginUser.UserTypeId == inQuery.UserTypeId) + .ProjectTo(_mapper.ConfigurationProvider); var pageList = await userLogQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, string.IsNullOrWhiteSpace(inQuery.SortField) ? "Id" : inQuery.SortField, inQuery.Asc);