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

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

View File

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