diff --git a/src/Oms.Application/Services/System/DictService.cs b/src/Oms.Application/Services/System/DictService.cs index 3fba8de..2bd2737 100644 --- a/src/Oms.Application/Services/System/DictService.cs +++ b/src/Oms.Application/Services/System/DictService.cs @@ -30,12 +30,13 @@ public class DictService : ApplicationService var predicate = BuildListPredicate(input); var pageIndex = OmsDocHelper.NormalizePage(input.Page); var pageSize = OmsDocHelper.NormalizePageSize(input.PageSize); - var items = await DictRepository.GetPagedListAsync( + // Fake GetPagedListAsync(sorting) 会丢失 Where:total 正确但 items 返回全量 + var (items, total) = await RepositoryPageHelper.GetPageAsync( + DictRepository, predicate, pageIndex, pageSize, - new Dictionary { [nameof(Dict.DictSort)] = true, [nameof(Dict.Id)] = false }); - var total = await DictRepository.CountAsync(predicate); + q => q.OrderBy(x => x.DictSort).ThenByDescending(x => x.Id)); return new OmsPageResult {