✨ feat(db): 修改对item表的数据库操作方式

This commit is contained in:
liangtongchuan
2023-05-06 17:44:56 +08:00
parent df35bee3b5
commit 76877348ba
7 changed files with 23 additions and 23 deletions
@@ -1,6 +1,6 @@
import { CURRENCY_TYPE, HANDLE_REWARD_TYPE, CURRENCY_BY_TYPE } from '../../consts';
import Role, { RoleType } from '../../db/Role';
import { ItemModel, ItemType } from '../../db/Item';
import Item, { ItemType } from '../../db/Item';
import { ItemInter, RewardInter, } from '../../pubUtils/interface';
import { gameData } from '../../pubUtils/data';
import { sortItems } from './util';
@@ -81,7 +81,7 @@ 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);
let item = await Item.findbyRoleAndGid(this.roleId, id);
console.log('#### decreaseItem', item);
if(!item) {
this.pushToNotEnoughItems(id, count);