diff --git a/game-server/app/servers/guild/handler/guildHandler.ts b/game-server/app/servers/guild/handler/guildHandler.ts index e36073497..af56c31c0 100644 --- a/game-server/app/servers/guild/handler/guildHandler.ts +++ b/game-server/app/servers/guild/handler/guildHandler.ts @@ -27,7 +27,6 @@ import { checkActivityTask, checkTask } from '../../../services/taskService'; import { guildInter } from '../../../pubUtils/interface'; import * as dicParam from '../../../pubUtils/dicParam'; import { reportTAEvent } from '../../../services/sdkService'; -import { addFund } from '../../../services/donateService'; export default function (app: Application) { @@ -933,17 +932,9 @@ export class GuildHandler { // if (magicWord !== DEBUG_MAGIC_WORD) { // return resResult(STATUS.TOKEN_ERR); // } - - let guild = await GuildModel.findByCode(code); - if(!guild) { - return resResult(STATUS.WRONG_PARMS); - } - - guild = await addFund(code, guild.serverId, count); - if(!guild) { - return resResult(STATUS.WRONG_PARMS); - } - + const guild = await GuildModel.updateInfo(code, {}, { fund: count }, 'fund'); + let chatSid = await getGuildChannelSid(code); + this.app.rpc.chat.guildRemote.updateInfo.toServer(chatSid, code, { fund: guild.fund }); return resResult(STATUS.SUCCESS, { code, fund: guild.fund }); } diff --git a/game-server/app/services/donateService.ts b/game-server/app/services/donateService.ts index ab19dd7a9..e5e4babb5 100644 --- a/game-server/app/services/donateService.ts +++ b/game-server/app/services/donateService.ts @@ -54,8 +54,8 @@ export async function addFund(code: string, serverId: number, fund: number) { refTodayFund = new Date(); } if(todayFund + fund > dicStructure.maxFund) { - todayFund = dicStructure.maxFund; fund = dicStructure.maxFund - todayFund; + todayFund = dicStructure.maxFund; } else { todayFund += fund; }