feat(db): 修改hero表数据库操作方式

This commit is contained in:
liangtongchuan
2023-05-06 17:07:48 +08:00
parent 3f3c1af549
commit 297e1af7ee
27 changed files with 133 additions and 137 deletions

View File

@@ -5,7 +5,7 @@ import { STATUS, GUILD_STRUCTURE, ITID, CONSUME_TYPE, HERO_QUALITY_TYPE, HERO_GR
import { UserShopModel } from "../../../db/UserShop";
import { handleCost, addItems } from "../../../services/role/rewardService";
import { SHOP } from "../../../pubUtils/dicParam";
import { HeroModel } from "../../../db/Hero";
import Hero from "../../../db/Hero";
import { checkShopInPurchase, getShopDicById, getShopListByType, getShopPrice } from "../../../services/shopService";
import { RewardInter } from "../../../pubUtils/interface";
import { UserShopTypeModel } from "../../../db/UserShopType";
@@ -124,7 +124,7 @@ export class ShopHandler {
return resResult(STATUS.ITEM_NOT_SOUL);
}
let hero = await HeroModel.findByHidAndRole(dicGoods.hid, roleId);
let hero = await Hero.findByHidAndRole(dicGoods.hid, roleId);
if(!hero) return resResult(STATUS.HERO_NOT_MAX);
if(hero.colorStar != HERO_GROW_MAX.COLORSTAR) return resResult(STATUS.HERO_NOT_MAX);