✨ feat(诸子列传): 查询其他好友数据

This commit is contained in:
luying
2023-07-13 16:23:29 +08:00
parent 1eb6f76cce
commit b6cd9e6784
5 changed files with 17 additions and 20 deletions
@@ -49,9 +49,7 @@ export class CheckMeterial {
this.notEnoughItems.clear();
let { items, gold, coin } = sortItems(goods, HANDLE_REWARD_TYPE.COST);
for(let { id, count} of items) {
console.log('#####', id, count)
let notEnoughCount = await this.decreaseItem(id, count);
console.log('##### notEnoughCount', id, notEnoughCount, this.canReplace)
if(notEnoughCount > 0) {
let isEnough = await this.checkReplaceItem(id, notEnoughCount);
if(isEnough) {
@@ -100,10 +98,8 @@ export class CheckMeterial {
}
private async decreaseItem(id: number, count: number) {
console.log('#### decreaseItem 1', id, count);
if(!this.itemsIndb.has(id)) {
let item = await ItemModel.findbyRoleAndGid(this.roleId, id);
console.log('#### decreaseItem', item);
if(!item) {
this.pushToNotEnoughItems(id, count);
return count;