红点:捐献所
This commit is contained in:
@@ -36,6 +36,7 @@ import { getAllOnlineRoles } from './redisService';
|
|||||||
import Item from '../db/Item';
|
import Item from '../db/Item';
|
||||||
import { PvpDefenseModel } from '../db/PvpDefense';
|
import { PvpDefenseModel } from '../db/PvpDefense';
|
||||||
import { findPvpDefAllByRoleId } from './pvpService';
|
import { findPvpDefAllByRoleId } from './pvpService';
|
||||||
|
import { getDonation } from './donateService';
|
||||||
|
|
||||||
export async function pushData(role: RoleType, session: FrontendOrBackendSession, pushType: 'entry'|'refresh' = 'entry') {
|
export async function pushData(role: RoleType, session: FrontendOrBackendSession, pushType: 'entry'|'refresh' = 'entry') {
|
||||||
try{
|
try{
|
||||||
@@ -47,7 +48,7 @@ export async function pushData(role: RoleType, session: FrontendOrBackendSession
|
|||||||
const guildData = await getGuildEntryData(role, sid, session);
|
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'];
|
let modules = ['shop', 'rank', 'mail', 'friend', 'daily', 'expedition', 'tower', 'comBattle', 'dungeon', 'pvp', 'gacha', 'school', 'task', 'chat', 'event', 'battle'];
|
||||||
if(guildData.hasGuild) {
|
if(guildData.hasGuild) {
|
||||||
modules.push('guild', 'auction', 'train', 'boss', 'wishPool', 'guildActivity');
|
modules.push('guild', 'auction', 'train', 'boss', 'wishPool', 'guildActivity', 'donate');
|
||||||
}
|
}
|
||||||
let notIncludeModule: string[] = [];
|
let notIncludeModule: string[] = [];
|
||||||
if(pushType == 'refresh') {
|
if(pushType == 'refresh') {
|
||||||
@@ -119,6 +120,12 @@ export async function pushData(role: RoleType, session: FrontendOrBackendSession
|
|||||||
return null;
|
return null;
|
||||||
case 'wishPool':
|
case 'wishPool':
|
||||||
return hasGuild? await getWishPool(userGuild): null;
|
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':
|
case 'task':
|
||||||
return await getCurTask(role.roleId, session);
|
return await getCurTask(role.roleId, session);
|
||||||
case 'chat':
|
case 'chat':
|
||||||
@@ -133,6 +140,7 @@ export async function pushData(role: RoleType, session: FrontendOrBackendSession
|
|||||||
return await getBattleListOfMain(role);
|
return await getBattleListOfMain(role);
|
||||||
case 'guildActivity':
|
case 'guildActivity':
|
||||||
return getAllGuildActivityStatus();
|
return getAllGuildActivityStatus();
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class Report {
|
|||||||
time: number;
|
time: number;
|
||||||
|
|
||||||
@prop({ required: true })
|
@prop({ required: true })
|
||||||
id: number;//捐献类型id
|
id: number;//捐献类型id 1-铜钱 2-元宝 3-至尊捐赠
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class Donation extends BaseModel {
|
export default class Donation extends BaseModel {
|
||||||
|
|||||||
Reference in New Issue
Block a user