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

This commit is contained in:
liangtongchuan
2023-05-06 15:48:16 +08:00
parent 2ff9f8c5f1
commit e65efa4192
79 changed files with 423 additions and 423 deletions

View File

@@ -18,7 +18,7 @@ import { checkTask } from '../../../services/task/taskService';
import { guildInter } from '../../../pubUtils/interface';
import { addItems, getGoldObject, handleCost } from '../../../services/role/rewardService';
import * as dicParam from '../../../pubUtils/dicParam';
import { RoleModel } from '../../../db/Role';
import Role from '../../../db/Role';
import { sendMailToGuildByContent } from '../../../services/mailService';
import { genAuction, getAuctionRewardByPoolId } from '../../../services/auctionService';
import { sendMessageToGuildWithSuc } from '../../../services/pushService';
@@ -243,7 +243,7 @@ export class GuildHandler {
let freeCount = dicParam.GUILD_BOSS.GUILD_BOSS_ENCOURAGE_FREECOUNT - myEncourageCnt > 0? dicParam.GUILD_BOSS.GUILD_BOSS_ENCOURAGE_FREECOUNT - myEncourageCnt: 0;
let costGold = (count - freeCount) * dicParam.GUILD_BOSS.GUILD_BOSS_ENCOURAGE_COST;
if(costGold < 0) costGold = 0;
let { gold } = await RoleModel.findByRoleId(roleId, 'gold');
let { gold } = await Role.findByRoleId(roleId, 'gold');
if(gold < costGold) return resResult(STATUS.BATTLE_GOLD_NOT_ENOUGH);
let { code, bossLv } = bossInstance;