This commit is contained in:
tanglong 2025-07-28 13:10:24 +08:00
parent 4b5dd2ccfc
commit adb7a5132b

View File

@ -127,7 +127,7 @@ namespace YD_AllHeartRates.Api.Services.Impl
var studentList = _caching.Get<List<StudentDto>>(studentListKey);
// 3. 如果缓存没有 → 查询数据库 + 写入缓存
if (studentList == null)
if (studentList == null || studentList.Count == 0)
{
studentList = await _sportsContext.Student
.Where(x => x.ClassId == classId && x.SchoolCode == schoolCode && x.StudentStatus == 1)