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

This reverts commit 97a36fda70fc1ccbb7f310b04d149f46f997a614.
This commit is contained in:
luying
2023-05-22 19:41:04 +08:00
parent 7700ed438a
commit 024f1e2776
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 Item, { ItemType } from '../../db/Item';
import { ItemModel, 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 Item.findbyRoleAndGid(this.roleId, id);
let item = await ItemModel.findbyRoleAndGid(this.roleId, id);
console.log('#### decreaseItem', item);
if(!item) {
this.pushToNotEnoughItems(id, count);