From 24fe256da0e1c87809349476cb8d76fc9d4579dd Mon Sep 17 00:00:00 2001 From: tanglong <842690096@qq.com> Date: Mon, 28 Jul 2025 16:33:09 +0800 Subject: [PATCH] d --- YD_AllHeartRates.Api/Services/Impl/DeviceService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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}的学生不存在!");