周末礼包

This commit is contained in:
dy 2023-12-14 17:53:52 +08:00
parent 39cb12ac9a
commit 39362ea6ab
2 changed files with 6 additions and 4 deletions

View File

@ -12,8 +12,6 @@ export default async function (call: ApiCall<ReqOpen, ResOpen>) {
let _hd = (await HuoDongFun.gethdList(call, 9))[0]
let payIds = _hd?.data?.gift?.filter(i => i.payId)?.map(i => i.payId)
await checkResetBuyLog(call)
await getConf(call)
call.succ({
record: data?.record || {},

View File

@ -99,7 +99,7 @@ export class PayFun {
}).toArray();
if (payIds?.length) {
return Object.fromEntries(payIds.map(id => [id, logs[id] || []]));
return Object.fromEntries(payIds.map(id => [id, logs.find(i => i.key == id)?.values || []]));
}
let allLogs = {}
logs.map(i => allLogs[i.key] = i.values)
@ -372,7 +372,11 @@ export class PayFun {
}
if (conf.buys > 0 && buyLog.length >= conf.buys) return G.server.sendMsgByUid(player.uid, 'msg_s2c/PayResult', {code: -1});
if (conf.time != -1 && buyLog.slice(-1)[0]?.eTime > G.time && conf.buys == 0) return G.server.sendMsgByUid(player.uid, 'msg_s2c/PayResult', {code: -2});
// todo 没看懂这个判断针对什么支付不支持周末礼包这个类型的限购所以加上判断payId.indexOf('wkdlibao') == -1
if (conf.time != -1 && buyLog.slice(-1)[0]?.eTime > G.time && conf.buys == 0 && payId.indexOf('wkdlibao') == -1) {
return G.server.sendMsgByUid(player.uid, 'msg_s2c/PayResult', {code: -2});
}
if (payId.indexOf('136Gift') != -1 && payId != '136Gift1') {
buyLog = await this.getPayLog(player.uid, '136Gift1');
if (buyLog.slice(-1)[0]?.eTime > G.time) return G.server.sendMsgByUid(player.uid, 'msg_s2c/PayResult', {code: -3});