Merge branch 'feature/yuandan' into dev

This commit is contained in:
dy 2023-12-26 14:30:20 +08:00
commit b6c7b3717b
3 changed files with 3 additions and 3 deletions

View File

@ -12,7 +12,7 @@ export default async function (call: ApiCall<ReqDMRec, ResDMRec>) {
// 校验当前领取奖励
let toPrize = call.req.prize
let prize = _hd.data.game.find(i => i.a == toPrize.a && i.t == toPrize.t && i.n == toPrize.n)
if (!prize) return call.errorCode(-2)
if (toPrize && !prize) return call.errorCode(-2)
// 取奖励列表,判断是否有可领取奖励
let data = await G.mongodb.cEvent(`yuandan${_hd.hdid}`).findOne({uid: call.uid, type: `yuandan${_hd.hdid}`})
@ -23,7 +23,7 @@ export default async function (call: ApiCall<ReqDMRec, ResDMRec>) {
await PlayerFun.cutNeed(call, _hd.data.gameneed);
}
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}`}, {
$inc: {[`gameNum`]: 1},

View File

@ -3,7 +3,7 @@
*/
export type ReqDMRec = {
id: string,
prize: { a: string, t: string, n: number }
prize: { a: string, t: string, n: number } | null
}
export type ResDMRec = {}