forked from wangziqi/gongxue-base
feat: integrate CampusScope.filter() into all business services (12 services + 12 modules)
This commit is contained in:
@@ -49,6 +49,13 @@ export class CampusScope {
|
||||
return { ...where, departmentId: In(ids) } as unknown as T;
|
||||
}
|
||||
|
||||
/** Returns department IDs for QueryBuilder .andWhere() usage. null = no filtering needed. */
|
||||
async getScopeDepartmentIds(): Promise<number[] | null> {
|
||||
if (this.isSuperAdmin && !this.currentDepartmentId) return null;
|
||||
const ids = await this.getEffectiveScopeIds();
|
||||
return ids.length > 0 ? ids : null;
|
||||
}
|
||||
|
||||
private async getEffectiveScopeIds(): Promise<number[]> {
|
||||
// Specific campus selected → campus + descendants
|
||||
if (this.currentDepartmentId) {
|
||||
|
||||
Reference in New Issue
Block a user