训练场宝箱展示bug
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { gameData, getGuildActiveWeekReward, getGuildActiveByIdAndType } from "../pubUtils/data";
|
||||
import { gameData, getGuildActiveWeekReward, getGuildActiveByIdAndType, getGoodById } from "../pubUtils/data";
|
||||
import { GuildModel, GuildType } from "../db/Guild";
|
||||
import { resResult, shouldRefresh } from "../pubUtils/util";
|
||||
import { STATUS, MAIL_TYPE, GUILD_AUTH, GUILD_JOB, REDIS_KEY, CHAT_SERVER } from "../consts";
|
||||
@@ -179,15 +179,18 @@ export async function getUserGuildWithRefActive(roleId: string, select: string,
|
||||
const now = new Date();
|
||||
let isRefDaily = shouldRefresh(refTimeDaily, now, 0);
|
||||
if(isRefDaily) {
|
||||
let goods = [];
|
||||
wishGoods.map(({ goodId, drawCnt})=>{
|
||||
if (drawCnt > 0)
|
||||
goods.push({id: goodId, count: drawCnt});
|
||||
let mails = new Array<MailType>();
|
||||
let pushMessage = new Array<pushMail>();
|
||||
wishGoods.map(async function ({donateNames, goodId, drawCnt}) {
|
||||
let goodInfo = getGoodById(goodId)
|
||||
if (!goodInfo)
|
||||
return;
|
||||
for (let i = 0; i < drawCnt; i++ ) {
|
||||
let donateName = donateNames[donateNames.length - i - 1];
|
||||
await getMailContent(roleId, MAIL_TYPE.WISH_POOL_REWARD, [donateName, goodInfo.name], [{id: goodId, count: drawCnt}], mails, pushMessage);
|
||||
}
|
||||
});
|
||||
if (!!goods.length) {
|
||||
let mails = new Array<MailType>();
|
||||
let pushMessage = new Array<pushMail>();
|
||||
await getMailContent(roleId, MAIL_TYPE.WISH_POOL_REWARD, [], goods, mails, pushMessage);
|
||||
if (!!mails.length) {
|
||||
await MailModel.addMails(mails);
|
||||
if (!notPush) {
|
||||
pushMessage.forEach(({route, data, uids })=>{
|
||||
|
||||
Reference in New Issue
Block a user