This commit is contained in:
tanglong 2025-08-25 17:14:14 +08:00
parent bd96de2331
commit 1b404c0d71
4 changed files with 4 additions and 8 deletions

View File

@ -272,15 +272,11 @@ namespace YD_XinWei.Api.Services.Impl
s.Rank, s.Rank,
s.ScoreTime s.ScoreTime
}) })
.Take(50)
.ToListAsync(); .ToListAsync();
// 2. 内存分组取每个学生最新一条 // 2. 内存分组取每个学生最新一条
var latestPerStudent = sourceData var latestPerStudent = sourceData.OrderBy(x=>x.ScoreTime).ToList();
.GroupBy(s => s.StudentNo)
.Select(g => g.First()) // 因为前面按 ScoreTime 排过
.OrderBy(s => s.ScoreTime)
.Take(50)
.ToList();
// 3. 映射到 DTO // 3. 映射到 DTO
var realTimeResults = latestPerStudent var realTimeResults = latestPerStudent

View File

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("YD_XinWei.Api")] [assembly: System.Reflection.AssemblyCompanyAttribute("YD_XinWei.Api")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f5873892e13dd05303d2e1923728ae8145db3bb6")] [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+bd96de2331a7d666a4d8e2b114e0470a03d1866f")]
[assembly: System.Reflection.AssemblyProductAttribute("YD_XinWei.Api")] [assembly: System.Reflection.AssemblyProductAttribute("YD_XinWei.Api")]
[assembly: System.Reflection.AssemblyTitleAttribute("YD_XinWei.Api")] [assembly: System.Reflection.AssemblyTitleAttribute("YD_XinWei.Api")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@ -1 +1 @@
1b55e451e5df8b5cfbeba624584454d98ac4b71c594cd85758e5968810368ab3 a7d3edef1797f546d7f154e83ba45b815ed5461c833e6055d7e38cbb05ed0590