军团捐献,许愿池,装备,养成 注释

This commit is contained in:
mamengke01
2021-02-24 18:34:54 +08:00
parent 87d7bf6a8e
commit 88d5e26753
9 changed files with 152 additions and 73 deletions
+10 -1
View File
@@ -4,6 +4,11 @@ import { getTodayZeroPoint, nowSeconds } from '../pubUtils/timeUtil';
import { GuildModel } from '../db/Guild';
import { findWhere } from 'underscore';
import { GUILD_STRUCTURE } from '../consts/constModules/guildConst';
/**
* 获得军团捐献,并检查是否刷新捐献数据
* @param code
* @param serverId
*/
export async function getDonation(code: string, serverId: number) {
let donation = await DonationModel.getDonation(code);
if (!donation) {
@@ -17,7 +22,11 @@ export async function getDonation(code: string, serverId: number) {
return donation;
}
/**
* 创建军团捐献信息
* @param code
* @param serverId
*/
export async function createDonation(code: string, serverId: number) {
let { structure } = await GuildModel.findGuild(code, serverId, 'structure');
let { lv } = findWhere(structure, {id: GUILD_STRUCTURE.DONATE});