Revert "✨ feat(db): 修改role表数据库操作方式"
This reverts commit e39af3649288cc5802739cfe862c818fe56e194e.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user