fix:1029的一些bug

This commit is contained in:
Antinew 2025-10-29 21:06:52 +08:00
parent 52c16b3738
commit d32c80ef1e

View File

@ -35,7 +35,12 @@ public class TrackContentRepository : BasicRepository<TrackContentEntity>, 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<TrackContentEntity>, 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<TrackContentEntity>, ITrac
.Select((a, b, e, f) => new GetTrackContentListVO
{
Id = a.Id,
App = a.AppKey,
Code = a.Code,
Content = a.Content,
EnContent = a.EnContent,