This commit is contained in:
tanglong 2025-07-28 16:33:09 +08:00
parent 3db004ef8d
commit 24fe256da0

View File

@ -150,7 +150,7 @@ namespace YD_AllHeartRates.Api.Services.Impl
{
if (!string.IsNullOrWhiteSpace(dto.StudentNo))
{
var student = await _sportsContext.Student.Where(x => x.StudentNo == dto.StudentNo).FirstOrDefaultAsync();
var student = await _sportsContext.Student.Where(x => x.StudentNo == dto.StudentNo && x.StudentStatus == 1).FirstOrDefaultAsync();
if (student == null)
throw new Exception($"学号:{dto.StudentNo}的学生不存在!");
@ -194,7 +194,7 @@ namespace YD_AllHeartRates.Api.Services.Impl
if (!string.IsNullOrWhiteSpace(dto.StudentNo))
{
var student = await _sportsContext.Student.Where(x => x.StudentNo == dto.StudentNo).FirstOrDefaultAsync();
var student = await _sportsContext.Student.Where(x => x.StudentNo == dto.StudentNo && x.StudentStatus == 1).FirstOrDefaultAsync();
if (student == null)
throw new Exception($"学号:{dto.StudentNo}的学生不存在!");