后台:活动组

This commit is contained in:
luying
2021-12-16 20:48:11 +08:00
parent 1628fd50b0
commit 5b1e3b6cab
8 changed files with 137 additions and 125 deletions

View File

@@ -89,6 +89,19 @@ export default class Activity_GroupType extends BaseModel {
return result;
}
public static async findAllActivityGroupTypes() {
let all: ActivityGroupTypeInter[] = [];
let createdAt;
for(let i = 0; i < 9999; i++) { // 防死循环
let condition = {};
if(createdAt) condition['createdAt'] = { $gt: createdAt }
let cur: ActivityGroupTypeInter[] = await ActivityGroupTypeModel.find(condition).limit(1000).sort({ createdAt: 1 }).lean();
if(cur.length == 0) break;
createdAt = cur[cur.length - 1].createdAt;
all.push(...cur);
}
return all;
}
}
export const ActivityGroupTypeModel = getModelForClass(Activity_GroupType);