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,