diff --git a/IRaCIS.Core.Application/Service/Common/CommonDocumentService.cs b/IRaCIS.Core.Application/Service/Common/CommonDocumentService.cs index 35eac6a73..8e0f9aae2 100644 --- a/IRaCIS.Core.Application/Service/Common/CommonDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Common/CommonDocumentService.cs @@ -37,8 +37,8 @@ namespace IRaCIS.Core.Application.Service .WhereIf(queryCommonDocument.CriterionTypeEnum != null, t => t.CriterionTypeEnum == queryCommonDocument.CriterionTypeEnum) .WhereIf(queryCommonDocument.BusinessScenarioEnum != null, t => t.BusinessScenarioEnum == queryCommonDocument.BusinessScenarioEnum) - .WhereIf(string.IsNullOrEmpty(queryCommonDocument.Code), t => t.Code.Contains(queryCommonDocument.Code)) - .WhereIf(string.IsNullOrEmpty(queryCommonDocument.Name), t => t.Name.Contains(queryCommonDocument.Name)) + .WhereIf(!string.IsNullOrEmpty(queryCommonDocument.Code), t => t.Code.Contains(queryCommonDocument.Code)) + .WhereIf(!string.IsNullOrEmpty(queryCommonDocument.Name), t => t.Name.Contains(queryCommonDocument.Name)) .ProjectTo(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken, userId = _userInfo.Id }); return await commonDocumentQueryable.ToPagedListAsync(queryCommonDocument); diff --git a/IRaCIS.Core.Infrastructure/_IRaCIS/IQueryablePageListExtensions.cs b/IRaCIS.Core.Infrastructure/_IRaCIS/IQueryablePageListExtensions.cs index 8ea41c369..caf5bac61 100644 --- a/IRaCIS.Core.Infrastructure/_IRaCIS/IQueryablePageListExtensions.cs +++ b/IRaCIS.Core.Infrastructure/_IRaCIS/IQueryablePageListExtensions.cs @@ -16,9 +16,9 @@ namespace IRaCIS.Core.Infrastructure.Extention //单字段排序 异步 (或者默认排序字段是空,多字段排序,传递了,就以传递的单字段为准) public static async Task> ToPagedListAsync(this IQueryable source, PageInput pageInput, string[] sortArray = default, CancellationToken cancellationToken = default) { - var isMultiSortFiled = true; + var isMultiSortFiled = false; - if (string.IsNullOrWhiteSpace(pageInput.SortField) && sortArray != default) + if (string.IsNullOrWhiteSpace(pageInput.SortField) && sortArray != default && sortArray != null) { isMultiSortFiled = true; }