From 87820f669a7b5d5d1502de479a3150efb12e89ad Mon Sep 17 00:00:00 2001 From: dy Date: Fri, 15 Dec 2023 12:17:58 +0800 Subject: [PATCH] fix bug --- src/api_s2c/event/zhoumolibao/ApiOpen.ts | 3 +-- src/public/pay.ts | 6 +----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/api_s2c/event/zhoumolibao/ApiOpen.ts b/src/api_s2c/event/zhoumolibao/ApiOpen.ts index 87bcca0..2401e66 100644 --- a/src/api_s2c/event/zhoumolibao/ApiOpen.ts +++ b/src/api_s2c/event/zhoumolibao/ApiOpen.ts @@ -16,7 +16,6 @@ export default async function (call: ApiCall) { record: data?.record || {}, buyLog: await PayFun.getPayLogs(call.uid, payIds) }) - checkResetBuyLog(call) } export async function getConf(call, args?: { id?: string; payId?: string }) { @@ -45,6 +44,6 @@ export async function checkResetBuyLog(call) { let payLogs = await PayFun.getPayLogs(call.uid, payIds) let payLogLength = R.flatten(R.values(payLogs)).filter(i => i.time < zeroTime).length if (payLogLength) { - PayFun.delPayLog(call.uid, payIds.map(i => ({payId: i, val: []}))) + PayFun.delPayLog(call.uid, ...payIds.map(i => ({payId: i, val: []}))) } } \ No newline at end of file diff --git a/src/public/pay.ts b/src/public/pay.ts index ef43757..9a72587 100644 --- a/src/public/pay.ts +++ b/src/public/pay.ts @@ -63,11 +63,7 @@ export class PayFun { ); }) - G.mongodb.collection('payLogNew').insertMany(args.filter(v => v.payId && v.val).map(i => ({ - key: i.payId, - uid: uid, - values: i.val - }))); + G.mongodb.collection('payLogNew').insertMany(args.map(i => ({key: i.payId, uid: uid, values: i.val}))); G.server.sendMsgByUid(uid, 'msg_s2c/PayChange', Object.fromEntries(args.map(a => [a.payId, a.val]))); }