活动:修复初始
This commit is contained in:
@@ -680,7 +680,7 @@ async function autoCreateServerSchedule(region: RegionType) {
|
||||
|
||||
// —————————————— 活动 start —————————————— //
|
||||
async function initTimeLimitRank() {
|
||||
let activities = await ActivityModel.findAllActivities();
|
||||
let activities = await ActivityModel.findActivityByType(ACTIVITY_TYPE.TIME_LIMIT_RANK);
|
||||
await updateTimeLimitRank(activities);
|
||||
}
|
||||
|
||||
|
||||
@@ -60,8 +60,8 @@ export default class Activity extends BaseModel {
|
||||
}
|
||||
|
||||
//根据活动类型查询活动数据
|
||||
public static async findActivityByType(activityGroupId: number[], type: number, sort: number) {
|
||||
let result: ActivityModelType[] = await ActivityModel.find({ groupId: { $in: activityGroupId }, type }).sort({ activityId: sort }).lean(true);
|
||||
public static async findActivityByType(type: number) {
|
||||
let result: ActivityModelType[] = await ActivityModel.find({ type }).lean(true);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -106,8 +106,8 @@ export default class Serverlist extends BaseModel {
|
||||
return server;
|
||||
}
|
||||
|
||||
public static async findByServerIds(serverIds: number[]) {
|
||||
let servers: ServerlistType[] = await ServerlistModel.find({ id: { $in: serverIds } }).select('medianCe activityGroupId').lean({ getters: true, virtuals: true });
|
||||
public static async findByServerIds(serverIds: number[], select?: string) {
|
||||
let servers: ServerlistType[] = await ServerlistModel.find({ id: { $in: serverIds } }).select(select).lean({ getters: true, virtuals: true });
|
||||
return servers;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user