红点:捐献所
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user