From 86910e7ad7534b262772265a2ef61ec1fe5251e8 Mon Sep 17 00:00:00 2001 From: chenkai Date: Fri, 22 Dec 2023 14:05:15 +0800 Subject: [PATCH] =?UTF-8?q?debug:=20=E6=B7=BB=E5=8A=A0=E7=8E=A9=E5=AE=B6?= =?UTF-8?q?=E9=A2=86=E5=8F=96=E8=AE=B0=E5=BD=95=E7=9A=84=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api_s2c/event/payForDiamond/ApiReceive.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/api_s2c/event/payForDiamond/ApiReceive.ts b/src/api_s2c/event/payForDiamond/ApiReceive.ts index 74d0170..0bcaab3 100644 --- a/src/api_s2c/event/payForDiamond/ApiReceive.ts +++ b/src/api_s2c/event/payForDiamond/ApiReceive.ts @@ -92,12 +92,13 @@ export default async function (call: ApiCall) { const zeroTime = PublicShared.getToDayZeroTime(); const setObj = {}; setObj[zeroTime] = gotAmount; - G.mongodb.cEvent('payForDiamond').updateOne({ uid: call.uid }, { + const updatecEventResult = await G.mongodb.cEvent('payForDiamond').updateOne({ uid: call.uid }, { $set: setObj }, {upsert: true}); + console.log('updatecEventResult', JSON.stringify(updatecEventResult)); // 记录玩家日志. 仅保留最近 10 条 if (showOff) { - G.mongodb.collection('hdinfo').updateOne({ hdid: call.req.activityId, }, { $push: { 'data.showOffList': { $each: [{ name: call.conn.gud.name, gotAmount }], $slice: -10 }}}); + await G.mongodb.collection('hdinfo').updateOne({ hdid: call.req.activityId, }, { $push: { 'data.showOffList': { $each: [{ name: call.conn.gud.name, gotAmount }], $slice: -10 }}}); } }