✨ feat(db): 修改hero表数据库操作方式
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { STATUS } from '../../../consts/statusCode';
|
||||
import Role, { RoleUpdate } from './../../../db/Role';
|
||||
import { HeroModel, HeroType, HeroUpdate } from '../../../db/Hero';
|
||||
import Hero, { HeroType, HeroUpdate } from '../../../db/Hero';
|
||||
import { resResult, decodeIdCntArrayStr, parseGoodStr, genCode } from '../../../pubUtils/util';
|
||||
import { Application, BackendSession, pinus, HandlerService, } from 'pinus';
|
||||
import { handleCost, addItems, getGoldObject, getCoinObject } from '../../../services/role/rewardService';
|
||||
@@ -219,7 +219,7 @@ export class RoleHandler {
|
||||
return resResult(STATUS.ROLE_SCHOOL_HERO_USED);
|
||||
}
|
||||
|
||||
curHero = await HeroModel.findByHidAndRole(hid, roleId);
|
||||
curHero = await Hero.findByHidAndRole(hid, roleId);
|
||||
if (!curHero) return resResult(STATUS.HERO_NOT_FIND);
|
||||
}
|
||||
|
||||
@@ -298,7 +298,7 @@ export class RoleHandler {
|
||||
let dicHero = gameData.hero.get(hid);
|
||||
if (!dicHero) return resResult(STATUS.DIC_DATA_NOT_FOUND);
|
||||
|
||||
let hero = await HeroModel.findByHidAndRole(hid, roleId, 'hid lv star colorStar quality scrollId scrollActive scrollStar scrollColorStar scrollQuality connections attr ce');
|
||||
let hero = await Hero.findByHidAndRole(hid, roleId, 'hid lv star colorStar quality scrollId scrollActive scrollStar scrollColorStar scrollQuality connections attr ce');
|
||||
if (!hero) return resResult(STATUS.HERO_NOT_FIND);
|
||||
|
||||
let { star, colorStar, quality, scrollId, scrollActive, scrollStar, scrollColorStar, scrollQuality } = hero;
|
||||
|
||||
Reference in New Issue
Block a user