✨ 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,5 +1,5 @@
import { MemComBtlTeam } from '../../domain/battleField/ComBattleTeamField';
import { ItemModel } from '../../db/Item';
import Item from '../../db/Item';
import { BATTLE_REWARD_TYPE, ITEM_CHANGE_REASON, IT_TYPE, PUSH_ROUTE } from '../../consts';
import { FriendRelationModel } from '../../db/FriendRelation';
import Role, { RoleType } from '../../db/Role';
@@ -505,7 +505,7 @@ export function blueprtIdValid(id: number) {
* @returns
*/
export async function hasEnoughBlueprt(roleId: string, sid: string, blueprtId: number) {
let blueprt = await ItemModel.findbyRoleAndGidAndCount(roleId, blueprtId, 1);
let blueprt = await Item.findbyRoleAndGidAndCount(roleId, blueprtId, 1);
if (!blueprt || blueprt.count <= 0) return false;
// 检查是否有已创建未结束的寻宝,预先占用一张藏宝图
// // 背包中占用的藏宝图不显示,所以这里就扣掉,结束再加回去