diff --git a/YD_AllHeartRates.Api/Services/Impl/DeviceService.cs b/YD_AllHeartRates.Api/Services/Impl/DeviceService.cs index c4f4ace..fb885a0 100644 --- a/YD_AllHeartRates.Api/Services/Impl/DeviceService.cs +++ b/YD_AllHeartRates.Api/Services/Impl/DeviceService.cs @@ -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}的学生不存在!");