修正挑战奖励返回异常的bug
This commit is contained in:
parent
1f898928de
commit
6abd7cfcf2
@ -149,7 +149,7 @@ class ExamController extends BaseController {
|
|||||||
rspData.rankTotal = rankTotal
|
rspData.rankTotal = rankTotal
|
||||||
let examData = await ShopExam.findById(history.activityId)
|
let examData = await ShopExam.findById(history.activityId)
|
||||||
let rewardList = []
|
let rewardList = []
|
||||||
if (!examData && examData.rewardInfo && examData.rewardInfo.length > 0) {
|
if (examData && examData.rewardInfo && examData.rewardInfo.length > 0) {
|
||||||
let rewards = examData.getReward(statMap.score)
|
let rewards = examData.getReward(statMap.score)
|
||||||
for (let reward of rewards) {
|
for (let reward of rewards) {
|
||||||
let geted = await UserReward.examRewardGeted(history, accountid, reward.id)
|
let geted = await UserReward.examRewardGeted(history, accountid, reward.id)
|
||||||
@ -160,10 +160,9 @@ class ExamController extends BaseController {
|
|||||||
rewardList.push(data)
|
rewardList.push(data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rspData.rewords = rewardList
|
rspData.rewards = rewardList
|
||||||
}
|
}
|
||||||
rspData.gameResult = gameResult
|
rspData.gameResult = gameResult
|
||||||
rspData.rewords = {}
|
|
||||||
return rspData
|
return rspData
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -135,6 +135,8 @@ class UserRewardClass extends BaseModule {
|
|||||||
})
|
})
|
||||||
if (history.type === 1) {
|
if (history.type === 1) {
|
||||||
record.activityId = history.activityId
|
record.activityId = history.activityId
|
||||||
|
} else if (history.type === 2) {
|
||||||
|
record.examId = history.activityId
|
||||||
}
|
}
|
||||||
await record.save()
|
await record.save()
|
||||||
ids.push(record.sid)
|
ids.push(record.sid)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user