修正抽卡时, 藏宝图数量判断错误的bug

This commit is contained in:
zhl 2021-02-01 11:01:50 +08:00
parent 6d479002d2
commit fbe60aff85

View File

@ -158,7 +158,7 @@ export default class CardController extends BaseController {
} }
} }
let record = await BagItem.findOne({accountid, itemid}) let record = await BagItem.findOne({accountid, itemid})
if (!record || record.count < count) { if (!record || record.count < itemInfo[0].count) {
throw new ZError(105, '解锁物品数量不足') throw new ZError(105, '解锁物品数量不足')
} }
const items: ItemInfo[] = [] const items: ItemInfo[] = []
@ -234,7 +234,7 @@ export default class CardController extends BaseController {
} }
await BagItem.addItems(accountid, itemToSave) await BagItem.addItems(accountid, itemToSave)
await account.save() await account.save()
record.count -= count record.count -= itemInfo[0].count
await record.save() await record.save()
return results return results
} }