feat(37需求): 添加返利数据到活动列表

This commit is contained in:
luying
2023-04-07 19:06:54 +08:00
parent f0a5809104
commit 2c5118dd5a
3 changed files with 8 additions and 1 deletions

View File

@@ -45,6 +45,7 @@ import { getPlayerForgeDataShow } from './forgeService';
import { getPlayerMiniGameDataShow } from './miniGameService';
import { getWeeklyFundDataShow } from './weeklyFundService';
import { getMonthlyFundData } from './monthlyFundService';
import { getPlayerRebateDataShow } from './rebateService';
/**
* 获取活动数据
@@ -256,6 +257,11 @@ export async function getActivity(serverId: number, roleId: string, uid: number,
activityData = await getMonthlyFundData(activityId, serverId, roleId);
break
}
case ACTIVITY_TYPE.REBATE:
{
activityData = await getPlayerRebateDataShow(activityId, serverId, roleId, uid);
break
}
default: {
console.log('未知活动类型.........', activityType)
break;

View File

@@ -65,6 +65,7 @@ export enum ACTIVITY_TYPE {
BIND_PHONE = 50, // 绑定手机号
WEEKLY_FUND = 51, // 周基金
MONTHLY_FUND = 52, // 月基金
REBATE = 53, // 返利
}
/**

View File

@@ -111,7 +111,7 @@ function multiRewards(rewards: string, multi: number) {
return arr.map(str => {
let [type, id, count] = str.split('&')||[];
if(type && id && count) {
let _count = Math.floor(parseInt(count) * multi);
let _count = Math.ceil(parseInt(count) * multi);
if(isNaN(_count)) return null;
return `${type}&${id}&${_count}`;
}