探索时, 只有得到分数大于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) {
throw new ZError(17, 'insufficient tickets.')
}
if (score > 0) {
await updateRankScore({
user: user.id,
score: score,
@ -425,6 +426,7 @@ class GameController extends BaseController {
step: step,
},
})
}
// batch save chests
for (let chest of chests) {
await chest.save()