资金:修改军团资金上限
This commit is contained in:
@@ -27,7 +27,6 @@ import { checkActivityTask, checkTask } from '../../../services/taskService';
|
|||||||
import { guildInter } from '../../../pubUtils/interface';
|
import { guildInter } from '../../../pubUtils/interface';
|
||||||
import * as dicParam from '../../../pubUtils/dicParam';
|
import * as dicParam from '../../../pubUtils/dicParam';
|
||||||
import { reportTAEvent } from '../../../services/sdkService';
|
import { reportTAEvent } from '../../../services/sdkService';
|
||||||
import { addFund } from '../../../services/donateService';
|
|
||||||
|
|
||||||
|
|
||||||
export default function (app: Application) {
|
export default function (app: Application) {
|
||||||
@@ -933,17 +932,9 @@ export class GuildHandler {
|
|||||||
// if (magicWord !== DEBUG_MAGIC_WORD) {
|
// if (magicWord !== DEBUG_MAGIC_WORD) {
|
||||||
// return resResult(STATUS.TOKEN_ERR);
|
// return resResult(STATUS.TOKEN_ERR);
|
||||||
// }
|
// }
|
||||||
|
const guild = await GuildModel.updateInfo(code, {}, { fund: count }, 'fund');
|
||||||
let guild = await GuildModel.findByCode(code);
|
let chatSid = await getGuildChannelSid(code);
|
||||||
if(!guild) {
|
this.app.rpc.chat.guildRemote.updateInfo.toServer(chatSid, code, { fund: guild.fund });
|
||||||
return resResult(STATUS.WRONG_PARMS);
|
|
||||||
}
|
|
||||||
|
|
||||||
guild = await addFund(code, guild.serverId, count);
|
|
||||||
if(!guild) {
|
|
||||||
return resResult(STATUS.WRONG_PARMS);
|
|
||||||
}
|
|
||||||
|
|
||||||
return resResult(STATUS.SUCCESS, { code, fund: guild.fund });
|
return resResult(STATUS.SUCCESS, { code, fund: guild.fund });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -54,8 +54,8 @@ export async function addFund(code: string, serverId: number, fund: number) {
|
|||||||
refTodayFund = new Date();
|
refTodayFund = new Date();
|
||||||
}
|
}
|
||||||
if(todayFund + fund > dicStructure.maxFund) {
|
if(todayFund + fund > dicStructure.maxFund) {
|
||||||
todayFund = dicStructure.maxFund;
|
|
||||||
fund = dicStructure.maxFund - todayFund;
|
fund = dicStructure.maxFund - todayFund;
|
||||||
|
todayFund = dicStructure.maxFund;
|
||||||
} else {
|
} else {
|
||||||
todayFund += fund;
|
todayFund += fund;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user