This commit is contained in:
dy 2023-12-15 12:17:58 +08:00
parent b39d0055ef
commit 87820f669a
2 changed files with 2 additions and 7 deletions

View File

@ -16,7 +16,6 @@ export default async function (call: ApiCall<ReqOpen, ResOpen>) {
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: []})))
}
}

View File

@ -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])));
}