捐献所
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
|
||||
import { DonationModel } from '../db/Donation';
|
||||
import { nowSeconds } from '../pubUtils/timeUtil';
|
||||
import { getTodayZeroPoint, nowSeconds } from '../pubUtils/timeUtil';
|
||||
import { GuildModel } from '../db/Guild';
|
||||
import { findWhere } from 'underscore';
|
||||
import { GUILD_STRUCTURE } from '../consts/constModules/guildConst';
|
||||
@@ -9,7 +9,7 @@ export async function getDonation(code: string, serverId: number) {
|
||||
if (!donation) {
|
||||
donation = await createDonation(code, serverId);
|
||||
}
|
||||
if (donation.refTime < nowSeconds()) {
|
||||
if (donation.refTime < getTodayZeroPoint()) {
|
||||
let { structure } = await GuildModel.findGuild(code, serverId, 'structure');
|
||||
let { lv } = findWhere(structure, {id: GUILD_STRUCTURE.DONATE});
|
||||
donation = await DonationModel.updateDonation(code, { donateFund:0, reports:[], refTime: nowSeconds(), donationLv: lv});
|
||||
|
||||
Reference in New Issue
Block a user