探索时, 只有得到分数大于0时, 才插入数据

This commit is contained in:
CounterFire2023 2024-05-13 15:08:09 +08:00
parent 604289fd5e
commit 14c8c156c8

View File

@ -416,15 +416,17 @@ class GameController extends BaseController {
if (!saveRes.lastErrorObject.updatedExisting) { if (!saveRes.lastErrorObject.updatedExisting) {
throw new ZError(17, 'insufficient tickets.') throw new ZError(17, 'insufficient tickets.')
} }
await updateRankScore({ if (score > 0) {
user: user.id, await updateRankScore({
score: score, user: user.id,
activity: user.activity, score: score,
scoreType: SCORE_GAME_STEP, activity: user.activity,
scoreParams: { scoreType: SCORE_GAME_STEP,
step: step, scoreParams: {
}, step: step,
}) },
})
}
// batch save chests // batch save chests
for (let chest of chests) { for (let chest of chests) {
await chest.save() await chest.save()