diff --git a/src/SJZY.Track.Repository/Repositories/OrderRepository.cs b/src/SJZY.Track.Repository/Repositories/OrderRepository.cs index fbdcdc51..17d41811 100644 --- a/src/SJZY.Track.Repository/Repositories/OrderRepository.cs +++ b/src/SJZY.Track.Repository/Repositories/OrderRepository.cs @@ -91,20 +91,19 @@ AND `a`.`IsDeleted` = 0 AND `b`.`IsDeleted` = 0 limit @pageSize", new { pageSize && b.CreateTime < createTime && !a.IsDeleted && !b.IsDeleted) - .Select((b, a) => new { Order = b }) + .Select((b, a) => new { b.LatestPushTime, b.Id, b.QuestionType }) .ToPageListAsync(pageindex, pageSize); var latestPushTimeIds = new List(); var questionZeroIds = new List(); foreach (var item in ordersToUpdate) { - var order = item.Order; - var questionType = !order.LatestPushTime.HasValue || order.LatestPushTime < DateTime.Now.AddHours(-12) + var questionType = !item.LatestPushTime.HasValue || item.LatestPushTime < DateTime.Now.AddHours(-12) ? 2 : 0; - if (order.QuestionType == questionType) continue; - if (questionType == 2) latestPushTimeIds.AddLast(order.Id); - else questionZeroIds.AddLast(order.Id); + if (item.QuestionType == questionType) continue; + if (questionType == 2) latestPushTimeIds.AddLast(item.Id); + else questionZeroIds.AddLast(item.Id); } int rows = 0;