From fa88c44593769088d664f6909ebacb3b44782356 Mon Sep 17 00:00:00 2001 From: dy Date: Wed, 20 Dec 2023 16:44:30 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A0=B4=E5=86=B0=E7=A4=BC=E5=8C=85fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/pobinglibao/ApiOpen.ts | 6 +++++- src/public/pay.ts | 5 +---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/api_s2c/event/pobinglibao/ApiOpen.ts b/src/api_s2c/event/pobinglibao/ApiOpen.ts index 77e62a5..b97d08a 100644 --- a/src/api_s2c/event/pobinglibao/ApiOpen.ts +++ b/src/api_s2c/event/pobinglibao/ApiOpen.ts @@ -12,7 +12,11 @@ export default async function (call: ApiCall) { let payIds = _hd?.data?.gift?.filter(i => i.payId)?.map(i => i.payId) - let payLog = await PayFun.getPayLogs(call.uid, payIds, [_hd.stime, _hd.etime]) + let payLog: any = await PayFun.getPayLogs(call.uid, payIds) + + for (let key in payLog) { + payLog[key]?.filter(i => i.time > _hd.stime && i.time < _hd.etime) + } call.succ({ record: data?.record || {}, diff --git a/src/public/pay.ts b/src/public/pay.ts index 4f25679..43a0e58 100644 --- a/src/public/pay.ts +++ b/src/public/pay.ts @@ -83,15 +83,12 @@ export class PayFun { return allPlayerPayLog?.[payId] || []; } - static async getPayLogs(uid: string, payIds?: string[], times?: number[]) { + static async getPayLogs(uid: string, payIds?: string[]) { let where = { uid: uid, del_time: {$exists: false} } if (payIds?.length) where['key'] = {$in: payIds} - if (times?.length) { - where['time'] = {$gte: times[0], $lte: times[1]} - } let logs = await G.mongodb.collection("payLogNew").find(where, { projection: {