From db2f3cc85a90af4a68be86613c02ef226609ad3b Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 5 Mar 2024 14:57:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Allocation/TaskMedicalReviewService.cs | 2 +- .../_IRaCIS/IQueryablePageListExtensions.cs | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs b/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs index 02081e74b..b0de77951 100644 --- a/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs @@ -224,7 +224,7 @@ namespace IRaCIS.Core.Application.Service .ProjectTo(_mapper.ConfigurationProvider); - var pageList = await taskMedicalReviewQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize,new string[] { "SubjectId asc" } ); + var pageList = await taskMedicalReviewQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize,new string[] { } ); return ResponseOutput.Ok(pageList, new { diff --git a/IRaCIS.Core.Infrastructure/_IRaCIS/IQueryablePageListExtensions.cs b/IRaCIS.Core.Infrastructure/_IRaCIS/IQueryablePageListExtensions.cs index ee6aa1189..ef697e09b 100644 --- a/IRaCIS.Core.Infrastructure/_IRaCIS/IQueryablePageListExtensions.cs +++ b/IRaCIS.Core.Infrastructure/_IRaCIS/IQueryablePageListExtensions.cs @@ -201,9 +201,13 @@ namespace IRaCIS.Core.Infrastructure.Extention return new PageOutput() { CurrentPageData = new T[0] }; } - var sortString = string.Join(',', sortArray); + if(sortArray.Count()>0) + { + var sortString = string.Join(',', sortArray); - source = source.OrderBy(sortString); + source = source.OrderBy(sortString); + } + source = source.Skip((pageNumber - 1) * pageSize); var items = await source