Merge branch 'feature/pay_for_diamond' into dev

This commit is contained in:
chenkai 2023-12-22 14:05:49 +08:00
commit 77f8380080

View File

@ -92,12 +92,13 @@ export default async function (call: ApiCall<ReqReceive, ResReceive>) {
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 }}});
}
}