Merge branch 'feature/yuandan' into dev

This commit is contained in:
dy 2023-12-27 09:51:50 +08:00
commit 47a9c6efb7

View File

@ -11,7 +11,7 @@ export default async function (call: ApiCall<ReqDMRec, ResDMRec>) {
// 奖励不符合 // 奖励不符合
let toPrize = call.req.prize let toPrize = call.req.prize
let prize = _hd.data.game.find(i => i.a == toPrize.a && i.t == toPrize.t && i.n == toPrize.n) let prize = _hd.data.game.find(i => i.a == toPrize?.a && i.t == toPrize?.t && i.n == toPrize?.n)
if (toPrize && !prize) return call.errorCode(-4) if (toPrize && !prize) return call.errorCode(-4)
// 扣除免费次数或相应货币 // 扣除免费次数或相应货币
@ -23,8 +23,8 @@ export default async function (call: ApiCall<ReqDMRec, ResDMRec>) {
await PlayerFun.cutNeed(call, _hd.data.gameneed); await PlayerFun.cutNeed(call, _hd.data.gameneed);
} }
if (prize){ if (prize) {
await PlayerFun.sendPrize(call, [prize] ); await PlayerFun.sendPrize(call, [prize]);
} }
await G.mongodb.cEvent(`yuandan${_hd.hdid}`).updateOne({uid: call.uid, type: `yuandan${_hd.hdid}`}, { await G.mongodb.cEvent(`yuandan${_hd.hdid}`).updateOne({uid: call.uid, type: `yuandan${_hd.hdid}`}, {