Revert " feat(db): 修改role表数据库操作方式"

This reverts commit e39af3649288cc5802739cfe862c818fe56e194e.
This commit is contained in:
luying
2023-05-08 10:01:05 +08:00
parent 2d45b2c66c
commit 7bc9e1fe49
79 changed files with 423 additions and 423 deletions

View File

@@ -2,7 +2,7 @@ import { Application, BackendSession } from 'pinus';
import { DailyRecordModel } from '../../../db/DailyRecord';
import { STATUS } from '../../../consts/statusCode';
import { resResult } from '../../../pubUtils/util';
import Role from '../../../db/Role';
import { RoleModel } from '../../../db/Role';
import { getDailyNum, getDailyBattleList, getDailyBuyCountCost } from '../../../services/dailyBattleService';
import { getGoldObject, handleCost } from '../../../services/role/rewardService';
import { gameData } from '../../../pubUtils/data';
@@ -20,7 +20,7 @@ export class DailyBattleHandler {
async getData(msg: { }, session: BackendSession) {
let roleId = session.get('roleId');
let role = await Role.findByRoleId(roleId);
let role = await RoleModel.findByRoleId(roleId);
let result = await getDailyBattleList(role);
return resResult(STATUS.SUCCESS, { list: result });
@@ -46,7 +46,7 @@ export class DailyBattleHandler {
let num = buyCount + i;
buyCost += getDailyBuyCountCost(num);
}
let role = await Role.findByRoleId(roleId);
let role = await RoleModel.findByRoleId(roleId);
if(buyCost > role.gold) {
return resResult(STATUS.DAILY_REFRESH_GOLD_LACK);
}