From c607af9736924c0386c78683d9cef678cee826da Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 24 Jan 2025 09:52:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=90=9C=E7=B4=A0=E6=9D=A1=E4=BB=B6=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Common/ExploreRecommendService.cs | 8 ++++---- .../Service/Common/SystemBasicDataService.cs | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Common/ExploreRecommendService.cs b/IRaCIS.Core.Application/Service/Common/ExploreRecommendService.cs index 59cce4aa2..b556fd445 100644 --- a/IRaCIS.Core.Application/Service/Common/ExploreRecommendService.cs +++ b/IRaCIS.Core.Application/Service/Common/ExploreRecommendService.cs @@ -25,10 +25,10 @@ namespace IRaCIS.Core.Application.Service var exploreRecommendQueryable = _exploreRecommendRepository.Where().IgnoreQueryFilters() - .WhereIf(string.IsNullOrEmpty(inQuery.Title), t => t.Title.Contains(inQuery.Title)) - .WhereIf(string.IsNullOrEmpty(inQuery.FileName), t => t.Title.Contains(inQuery.FileName)) - .WhereIf(string.IsNullOrEmpty(inQuery.DownloadUrl), t => t.Title.Contains(inQuery.DownloadUrl)) - .WhereIf(string.IsNullOrEmpty(inQuery.Version), t => t.Title.Contains(inQuery.Version)) + .WhereIf(!string.IsNullOrEmpty(inQuery.Title), t => t.Title.Contains(inQuery.Title)) + .WhereIf(!string.IsNullOrEmpty(inQuery.FileName), t => t.Title.Contains(inQuery.FileName)) + .WhereIf(!string.IsNullOrEmpty(inQuery.DownloadUrl), t => t.Title.Contains(inQuery.DownloadUrl)) + .WhereIf(!string.IsNullOrEmpty(inQuery.Version), t => t.Title.Contains(inQuery.Version)) .WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == t.IsDeleted) .ProjectTo(_mapper.ConfigurationProvider); diff --git a/IRaCIS.Core.Application/Service/Common/SystemBasicDataService.cs b/IRaCIS.Core.Application/Service/Common/SystemBasicDataService.cs index bc1832680..f76d52f41 100644 --- a/IRaCIS.Core.Application/Service/Common/SystemBasicDataService.cs +++ b/IRaCIS.Core.Application/Service/Common/SystemBasicDataService.cs @@ -5,6 +5,7 @@ //-------------------------------------------------------------------- using IRaCIS.Core.Application.Contracts; +using IRaCIS.Core.Infrastructure.Extention; using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Services { @@ -25,7 +26,10 @@ namespace IRaCIS.Core.Application.Services [HttpPost] public async Task> GetSystemBasicDataList(SystemBasicDataQuery inQuery) { - var systemBasicDataQueryable = _systemBasicDataRepository.Where(t => t.ParentId == null) + var systemBasicDataQueryable = _systemBasicDataRepository + .Where(t => t.ParentId == null) + .WhereIf(inQuery.Code != null, t => t.Code.Contains(inQuery.Code)) + .WhereIf(inQuery.Name != null, t => t.Name.Contains(inQuery.Name)) .ProjectTo(_mapper.ConfigurationProvider); return await systemBasicDataQueryable.ToPagedListAsync(inQuery, nameof(SystemBasicDataView.Code));