feat(server): 统一课表解析并完善权限范围与年度升级
This commit is contained in:
1 parent
66ef878a71
commit
4dc824c283
54 files changed
+2401
-625
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import { classDeviceClassId, isClassDevice } from './access.js';
|
||||
import { activeStudentWhere } from './students.js';
|
||||
import { prisma } from './db.js';
|
||||
import type { TokenPayload } from './jwt.js';
|
||||
|
||||
@@ -26,7 +27,7 @@ export function classSessionClassId(user: TokenPayload): string | null {
|
||||
/** 该班级的全部学生 id(班级端的"全班"范围) */
|
||||
export async function listClassStudentIds(classId: string): Promise<string[]> {
|
||||
const students = await prisma.student.findMany({
|
||||
where: { classId, status: { not: 'inactive' } },
|
||||
where: { classId, ...activeStudentWhere() },
|
||||
select: { id: true },
|
||||
});
|
||||
return students.map((item) => item.id);
|
||||
|
||||
Reference in new issue
Block a user