返利:达到等级发返利邮件
This commit is contained in:
@@ -4,7 +4,7 @@ import Role, { RoleModel, RoleType, WarCount } from '../db/Role'
|
||||
import { getLvByExp, getExpByLv, gameData, getDicApByLv } from '../pubUtils/data';
|
||||
import { updateRoleOnlineInfo, updateUserInfo } from './redisService';
|
||||
// import { switchOnFunc } from './funcSwitchService';
|
||||
import { FUNC_OPT_TYPE, TASK_TYPE, WAR_TYPE, STATUS, KING_EXP_RATIO_TYPE, ITEM_CHANGE_REASON, POP_UP_SHOP_CONDITION_TYPE, HERO_SYSTEM_TYPE, PUSH_ROUTE } from '../consts';
|
||||
import { FUNC_OPT_TYPE, TASK_TYPE, WAR_TYPE, STATUS, KING_EXP_RATIO_TYPE, ITEM_CHANGE_REASON, POP_UP_SHOP_CONDITION_TYPE, HERO_SYSTEM_TYPE, PUSH_ROUTE, REBATE_LV } from '../consts';
|
||||
import { BackendSession, pinus } from 'pinus';
|
||||
import { REDIS_KEY } from '../consts';
|
||||
import { Rank } from './rankService';
|
||||
@@ -20,6 +20,7 @@ import { calculateCeWithRole } from './playerCeService';
|
||||
import { sendMessageToUserWithSuc } from './pushService';
|
||||
import { ActionPointModel } from '../db/ActionPoint';
|
||||
import { GK_MAIN, GK_MAINELITE } from '../pubUtils/dicParam';
|
||||
import { rebateHistoryOrder } from './orderService';
|
||||
|
||||
export async function roleLevelup(type: KING_EXP_RATIO_TYPE, roleId: string, kingExp: number = 0, session: BackendSession) {
|
||||
const serverId = session.get('serverId');
|
||||
@@ -51,7 +52,10 @@ export async function roleLevelup(type: KING_EXP_RATIO_TYPE, roleId: string, kin
|
||||
// await calculateCeWithRole(HERO_SYSTEM_TYPE.ROLE_LV, roleId, serverId, sid, { lv: newLv });
|
||||
|
||||
await updateRoleOnlineInfo(roleId, { lv: newLv });
|
||||
|
||||
// 达到等级返利
|
||||
if(lv < REBATE_LV && newLv >= REBATE_LV) {
|
||||
rebateHistoryOrder(roleId, role.userInfo?.uid);
|
||||
}
|
||||
}
|
||||
let actordata: { lv: number, exp: number, getExp: number, mostExp: number }[] = [];
|
||||
for (let i = lv; i <= newLv; i++) {
|
||||
|
||||
Reference in New Issue
Block a user