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