From b3b9f4b1b803b9c7835161e18893f7919ab33ee7 Mon Sep 17 00:00:00 2001 From: luying Date: Fri, 18 Jun 2021 15:19:51 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=A2=E7=82=B9=EF=BC=9A=E6=8D=90=E7=8C=AE?= =?UTF-8?q?=E6=89=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/services/connectorService.ts | 10 +++++++++- shared/db/Donation.ts | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/game-server/app/services/connectorService.ts b/game-server/app/services/connectorService.ts index 3b675a1c6..68105becc 100644 --- a/game-server/app/services/connectorService.ts +++ b/game-server/app/services/connectorService.ts @@ -36,6 +36,7 @@ import { getAllOnlineRoles } from './redisService'; import Item from '../db/Item'; import { PvpDefenseModel } from '../db/PvpDefense'; import { findPvpDefAllByRoleId } from './pvpService'; +import { getDonation } from './donateService'; export async function pushData(role: RoleType, session: FrontendOrBackendSession, pushType: 'entry'|'refresh' = 'entry') { try{ @@ -47,7 +48,7 @@ export async function pushData(role: RoleType, session: FrontendOrBackendSession const guildData = await getGuildEntryData(role, sid, session); let modules = ['shop', 'rank', 'mail', 'friend', 'daily', 'expedition', 'tower', 'comBattle', 'dungeon', 'pvp', 'gacha', 'school', 'task', 'chat', 'event', 'battle']; if(guildData.hasGuild) { - modules.push('guild', 'auction', 'train', 'boss', 'wishPool', 'guildActivity'); + modules.push('guild', 'auction', 'train', 'boss', 'wishPool', 'guildActivity', 'donate'); } let notIncludeModule: string[] = []; if(pushType == 'refresh') { @@ -119,6 +120,12 @@ export async function pushData(role: RoleType, session: FrontendOrBackendSession return null; case 'wishPool': return hasGuild? await getWishPool(userGuild): null; + case 'donate': + if(hasGuild) { + const { guildCode: code, donateCnt, receiveBoxs } = userGuild; + let { donateFund, reports, donationLv } = await getDonation(code, serverId); + return { receiveBoxs, donateFund, reports, donateCnt:donateCnt||0, donationLv}; + } case 'task': return await getCurTask(role.roleId, session); case 'chat': @@ -133,6 +140,7 @@ export async function pushData(role: RoleType, session: FrontendOrBackendSession return await getBattleListOfMain(role); case 'guildActivity': return getAllGuildActivityStatus(); + default: return null; } diff --git a/shared/db/Donation.ts b/shared/db/Donation.ts index 4cb9d24e1..32da02bb2 100644 --- a/shared/db/Donation.ts +++ b/shared/db/Donation.ts @@ -10,7 +10,7 @@ class Report { time: number; @prop({ required: true }) - id: number;//捐献类型id + id: number;//捐献类型id 1-铜钱 2-元宝 3-至尊捐赠 } export default class Donation extends BaseModel {