fix:
修复终身卡每周奖励未发放bug
This commit is contained in:
parent
3898cee713
commit
b79d80beed
@ -3,6 +3,7 @@ import {PublicShared} from "../../shared/public/public";
|
|||||||
import { Wjjl } from "../../module/collection_wjjl";
|
import { Wjjl } from "../../module/collection_wjjl";
|
||||||
import { ZhanLingTasks } from "../zhanling";
|
import { ZhanLingTasks } from "../zhanling";
|
||||||
import { setGud } from '../gud';
|
import { setGud } from '../gud';
|
||||||
|
import { EmailFun } from '../email';
|
||||||
|
|
||||||
|
|
||||||
export class SchedulerNewDayLocalCtor extends Scheduler {
|
export class SchedulerNewDayLocalCtor extends Scheduler {
|
||||||
@ -36,7 +37,7 @@ export class SchedulerNewDayLocalCtor extends Scheduler {
|
|||||||
if (gud.logoutTime && PublicShared.getToWeekMondayZeroTime(gud.logoutTime) < PublicShared.getToWeekMondayZeroTime(G.time)) {
|
if (gud.logoutTime && PublicShared.getToWeekMondayZeroTime(gud.logoutTime) < PublicShared.getToWeekMondayZeroTime(G.time)) {
|
||||||
ZhanLingTasks.clearLog(gud.uid, 'week');
|
ZhanLingTasks.clearLog(gud.uid, 'week');
|
||||||
}
|
}
|
||||||
G.emit('FIRST_LOGIN_EVERY_DAY', gud, G.time - 24 * 3600, G.time);
|
G.emit('FIRST_LOGIN_EVERY_DAY', gud, gud.loginTime, G.time);
|
||||||
}
|
}
|
||||||
gud.loginTime = G.time;
|
gud.loginTime = G.time;
|
||||||
add.loginTime = G.time;
|
add.loginTime = G.time;
|
||||||
@ -54,5 +55,28 @@ export class SchedulerNewDayLocalCtor extends Scheduler {
|
|||||||
}
|
}
|
||||||
G.server.broadcastClusterMsg('msg_s2c/NewDay', { time: this.zeroTime });
|
G.server.broadcastClusterMsg('msg_s2c/NewDay', { time: this.zeroTime });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
(async () => {
|
||||||
|
// 每周一,发放终身卡
|
||||||
|
if (PublicShared.getWeek(G.time) != 1) return;
|
||||||
|
|
||||||
|
let logs = await G.mongodb.collection("payLogNew").find(
|
||||||
|
{ key: "zhongshengka", del_time: { $exists: false } }, { projection: { _id: 0, } }
|
||||||
|
).toArray();
|
||||||
|
|
||||||
|
let con = G.gc.payEmail.zhongshenka.filter(e => e.day == 7)[0];
|
||||||
|
for (let i = 0; i < logs.length; i++) {
|
||||||
|
// 发送邮件
|
||||||
|
EmailFun.addEmail({
|
||||||
|
uid: logs[i].uid,
|
||||||
|
type: con.type,
|
||||||
|
title: con.title,
|
||||||
|
content: con.content,
|
||||||
|
contentInsertArr: [],
|
||||||
|
createTime: G.time,
|
||||||
|
prize:con.prize,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user