This commit is contained in:
tanglong 2025-07-28 14:11:32 +08:00
parent 6f828ee8dd
commit 65874b3b86

View File

@ -60,7 +60,7 @@ namespace YD_AllHeartRates.Api.Services.Impl
var studentList = await ( var studentList = await (
from s in _sportsContext.Student from s in _sportsContext.Student
join c in _sportsContext.Class on s.ClassId equals c.Id join c in _sportsContext.Class on s.ClassId equals c.Id
where s.SchoolCode == schoolCode where s.SchoolCode == schoolCode && s.StudentStatus == 1
select new { s.StudentNo, s.Sex, c.GradeId }).ToListAsync(); select new { s.StudentNo, s.Sex, c.GradeId }).ToListAsync();
res.GradeCount = gradeList.Count; res.GradeCount = gradeList.Count;
@ -149,7 +149,7 @@ namespace YD_AllHeartRates.Api.Services.Impl
var studentList = await ( var studentList = await (
from s in _sportsContext.Student from s in _sportsContext.Student
join c in _sportsContext.Class on s.ClassId equals c.Id join c in _sportsContext.Class on s.ClassId equals c.Id
where c.SchoolCode == schoolCode && c.GradeId == gradeId where c.SchoolCode == schoolCode && c.GradeId == gradeId && s.StudentStatus == 1
select new { s.StudentNo, s.Sex, ClassId = c.Id }).ToListAsync(); select new { s.StudentNo, s.Sex, ClassId = c.Id }).ToListAsync();
res.GradeName = classList.FirstOrDefault()?.GradeName ?? ""; res.GradeName = classList.FirstOrDefault()?.GradeName ?? "";
@ -231,7 +231,7 @@ namespace YD_AllHeartRates.Api.Services.Impl
select new { c.GradeName, c.ClassName, t.TeacherName }).FirstOrDefaultAsync(); select new { c.GradeName, c.ClassName, t.TeacherName }).FirstOrDefaultAsync();
var studentList = await _sportsContext.Student var studentList = await _sportsContext.Student
.Where(s => s.SchoolCode == schoolCode && s.ClassId == classId) .Where(s => s.SchoolCode == schoolCode && s.ClassId == classId && s.StudentStatus == 1)
.Select(s => new { s.StudentNo, s.StudentName, s.Age, s.Sex, s.Photo }).ToListAsync(); .Select(s => new { s.StudentNo, s.StudentName, s.Age, s.Sex, s.Photo }).ToListAsync();
res.GradeName = classInfo?.GradeName ?? ""; res.GradeName = classInfo?.GradeName ?? "";