fix:
修复终身卡每周奖励未发放bug
This commit is contained in:
parent
3898cee713
commit
b79d80beed
@ -1,8 +1,9 @@
|
||||
import { Scheduler, schedulerType } from './scheduler';
|
||||
import {PublicShared} from "../../shared/public/public";
|
||||
import {Wjjl} from "../../module/collection_wjjl";
|
||||
import {ZhanLingTasks} from "../zhanling";
|
||||
import { PublicShared } from "../../shared/public/public";
|
||||
import { Wjjl } from "../../module/collection_wjjl";
|
||||
import { ZhanLingTasks } from "../zhanling";
|
||||
import { setGud } from '../gud';
|
||||
import { EmailFun } from '../email';
|
||||
|
||||
|
||||
export class SchedulerNewDayLocalCtor extends Scheduler {
|
||||
@ -23,8 +24,8 @@ export class SchedulerNewDayLocalCtor extends Scheduler {
|
||||
|
||||
async start() {
|
||||
let users = Object.values(G.server.uid_connections)
|
||||
if(users.length) {
|
||||
for (let item of users){
|
||||
if (users.length) {
|
||||
for (let item of users) {
|
||||
let gud = item.gud
|
||||
let add: k_v<any> = {};
|
||||
//每天首次登陆
|
||||
@ -36,23 +37,46 @@ export class SchedulerNewDayLocalCtor extends Scheduler {
|
||||
if (gud.logoutTime && PublicShared.getToWeekMondayZeroTime(gud.logoutTime) < PublicShared.getToWeekMondayZeroTime(G.time)) {
|
||||
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;
|
||||
add.loginTime = G.time;
|
||||
|
||||
if (Object.keys(add).length > 0) {
|
||||
G.mongodb.collection('user').updateOne({ bindUid: gud.bindUid,sid:gud.sid }, {
|
||||
G.mongodb.collection('user').updateOne({ bindUid: gud.bindUid, sid: gud.sid }, {
|
||||
$set: {
|
||||
...add
|
||||
}
|
||||
});
|
||||
setGud(gud.uid,add);
|
||||
setGud(gud.uid, add);
|
||||
}
|
||||
G.server.sendMsgByUid(gud.uid, 'msg_s2c/PlayerChange', gud)
|
||||
|
||||
}
|
||||
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