Merge branch 'feature/yuandan' into dev
This commit is contained in:
commit
b6c7b3717b
@ -12,7 +12,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 (!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}`})
|
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.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}`}, {
|
await G.mongodb.cEvent(`yuandan${_hd.hdid}`).updateOne({uid: call.uid, type: `yuandan${_hd.hdid}`}, {
|
||||||
$inc: {[`gameNum`]: 1},
|
$inc: {[`gameNum`]: 1},
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
export type ReqDMRec = {
|
export type ReqDMRec = {
|
||||||
id: string,
|
id: string,
|
||||||
prize: { a: string, t: string, n: number }
|
prize: { a: string, t: string, n: number } | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ResDMRec = {}
|
export type ResDMRec = {}
|
||||||
|
Loading…
Reference in New Issue
Block a user