From d32c80ef1e9b85638484d663bf4e5f01e1db6645 Mon Sep 17 00:00:00 2001 From: Antinew <2357729423@qq.com> Date: Wed, 29 Oct 2025 21:06:52 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A1029=E7=9A=84=E4=B8=80=E4=BA=9Bbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Repositories/TrackContentRepository.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/TrackCenter.Repository/Repositories/TrackContentRepository.cs b/src/TrackCenter.Repository/Repositories/TrackContentRepository.cs index 58710a29..def738f1 100644 --- a/src/TrackCenter.Repository/Repositories/TrackContentRepository.cs +++ b/src/TrackCenter.Repository/Repositories/TrackContentRepository.cs @@ -35,7 +35,12 @@ public class TrackContentRepository : BasicRepository, ITrac IsAllowManuallyUpdate = a.IsAllowManuallyUpdate, IsAllowManuallyCreate = a.IsAllowManuallyCreate }) - .Mapper(x => { x.TrackFlagIds = x.TrackFlagId?.Split(',').Select(int.Parse).ToList(); }) + .Mapper(x => + { + x.TrackFlagIds = x.TrackFlagId.IsNullOrEmpty() + ? [] + : x.TrackFlagId!.Split(',').Select(int.Parse).ToList(); + }) .FirstAsync(); return detail; } @@ -54,8 +59,9 @@ public class TrackContentRepository : BasicRepository, ITrac .WhereIF(!input.AppKey.IsNullOrWhiteSpace(), (a, b, e, f) => a.AppKey == input.AppKey) .WhereIF(!input.Keywords.IsNullOrWhiteSpace(), (a, b, e, f) => a.Code.Contains(input.Keywords!) || a.Content.Contains(input.Keywords!) - || a.EnContent.Contains(input.Keywords!)) - .WhereIF(input.TrackStatusId.HasValue && input.TrackStatusId > 0, (a, b, e, f) => a.TrackStatusId == input.TrackStatusId) + || a.EnContent.Contains(input.Keywords!)) + .WhereIF(input.TrackStatusId.HasValue && input.TrackStatusId > 0, + (a, b, e, f) => a.TrackStatusId == input.TrackStatusId) .OrderByIF(input.SelectIds.IsNullOrEmpty(), (a, b, e, f) => a.CreateTime, OrderByType.Desc) .OrderByIF(!input.SelectIds.IsNullOrEmpty(), (a, b, e, f) => SqlFunc.IIF(input.SelectIds!.Contains(a.Id), SqlFunc.DateAdd(SqlFunc.GetDate(), 1), @@ -63,6 +69,7 @@ public class TrackContentRepository : BasicRepository, ITrac .Select((a, b, e, f) => new GetTrackContentListVO { Id = a.Id, + App = a.AppKey, Code = a.Code, Content = a.Content, EnContent = a.EnContent,