From c23542248ef6f7241d8ff6447c33439809c2cc86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=9F=E5=96=9C=E6=97=BA?= Date: Wed, 7 Aug 2024 10:47:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20select=20=E9=99=90=E5=AE=9A=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Repositories/OrderRepository.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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;