diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs index 8acfa26dc..6050eed50 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs @@ -35,6 +35,9 @@ namespace IRaCIS.Core.Application.Service [HttpPost] public async Task>> GetUserJoinedTrialList(IdentityUserJoinedTrialQuery inQuery) { + + var defalutSortArray = new string[] { nameof(IdentityUserJoinedTrialView.TrialCreateTime) + " desc" }; + var list = await _trialIdentityUserRepository.Where(t => t.IdentityUserId == inQuery.IdentityUserId && t.Trial.IsDeleted==false, false, true) .WhereIf(!string.IsNullOrEmpty(inQuery.TrialCode), o => o.Trial.TrialCode.Contains(inQuery.TrialCode)) .WhereIf(!string.IsNullOrEmpty(inQuery.ResearchProgramNo), o => o.Trial.ResearchProgramNo.Contains(inQuery.ResearchProgramNo)) @@ -62,7 +65,7 @@ namespace IRaCIS.Core.Application.Service UpdateTime = t.UpdateTime, }).ToList(), - }).ToPagedListAsync(inQuery); + }).ToPagedListAsync(inQuery, defalutSortArray); var info = await _identityUserRepository.Where(t => t.Id == inQuery.IdentityUserId).Select(t => new { t.CreateTime, t.UserCeateSource, t.Trial.ResearchProgramNo, t.Trial.ExperimentName, t.Trial.TrialCode }).FirstOrDefaultAsync();