pvp:修复赛季显示

This commit is contained in:
luying
2021-11-02 11:36:14 +08:00
parent 4c80a22ccf
commit 14027b1732
4 changed files with 43 additions and 9 deletions
+6
View File
@@ -43,6 +43,12 @@ export default class PvpSeasonResult extends BaseModel {
let result: PvpSeasonResultType = await PvpSeasonResultModel.findOneAndUpdate({roleId, seasonNum}, {$set: update}, {upsert: true, new: true}).lean(lean);
return result;
}
public static async setShow(roleId: string) {
let result = await PvpSeasonResultModel.updateMany({ roleId, show: true }, { show: false }).lean();
return result;
}
public static async getPvpSeasonResult(roleId: string) {
let result: PvpSeasonResultType = await PvpSeasonResultModel.findOne({ roleId, show: true }).lean();
return result;