Merge remote-tracking branch 'origin/bugfix' into bugfix

This commit is contained in:
dy 2023-12-28 13:39:54 +08:00
commit 053ab1ab23
2 changed files with 34 additions and 11 deletions

View File

@ -38,9 +38,7 @@ export default async function (call: ApiCall<ReqAllGet, ResAllGet>) {
}
// XstaskFun.delTask(call.uid, task._id);
XstaskFun.changeInfo(call.uid, change);
await PlayerFun.sendPrize(call, taskConf.prize);
HongDianChange.sendChangeKey(call.uid, ['xstaskhd', 'huodonghd']);
if (!tequan) {
prizeArr.push(...taskConf.prize)
} else {
@ -50,6 +48,7 @@ export default async function (call: ApiCall<ReqAllGet, ResAllGet>) {
}
// prizeArr.push(...taskConf.prize)
}
if (prizeArr.length > 0) await PlayerFun.sendPrize(call, prizeArr);
call.succ({
taskList: await XstaskFun.getAllTask(call.uid),
prize: PublicShared.mergePrize(prizeArr)

View File

@ -3,6 +3,7 @@ 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 {
@ -36,7 +37,7 @@ 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;
@ -54,5 +55,28 @@ export class SchedulerNewDayLocalCtor extends Scheduler {
}
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,
})
}
})()
}
}