寻宝:获得最近组过队的人
This commit is contained in:
@@ -6,7 +6,7 @@ import { difference } from 'underscore';
|
||||
* @Last Modified by: 梁桐川
|
||||
* @Last Modified time: 2021-03-10 20:15:30
|
||||
*/
|
||||
import { IT_TYPE, CURRENCY_BY_TYPE, CURRENCY_TYPE, COM_TEAM_STATUS, COM_BTL_CONST, CONSUME_TYPE, COM_BTL_QUALITY, MSG_SOURCE, QUALITY_TYPE } from './../../../consts';
|
||||
import { IT_TYPE, CURRENCY_BY_TYPE, CURRENCY_TYPE, COM_TEAM_STATUS, COM_BTL_CONST, CONSUME_TYPE, COM_BTL_QUALITY, MSG_SOURCE, QUALITY_TYPE, ROLE_SELECT } from './../../../consts';
|
||||
import { getGoodById, getBlueprtComposeByQuality, getBluePrtByQuality, getWarById, getWarIdByBlueprtId } from '../../../pubUtils/gamedata';
|
||||
import Role, { RoleModel } from '../../../db/Role';
|
||||
import { STATUS } from '../../../consts/statusCode';
|
||||
@@ -23,6 +23,8 @@ import { addUserToChannel } from '../../../services/roleService';
|
||||
import { ChannelUser } from '../../../domain/ChannelUser';
|
||||
import { pushComBtlTeamMsg, pushFriendTeamInviteMsg, pushNormalEquipMsg, pushTeamInviteMsg } from '../../../services/chatService';
|
||||
import { EXTERIOR } from '../../../pubUtils/dicParam';
|
||||
import { getTodayZeroDate } from '../../../pubUtils/timeUtil';
|
||||
import { FriendParams } from '../../../domain/roleField/friend';
|
||||
|
||||
export default function(app: Application) {
|
||||
return new ComBattleHandler(app);
|
||||
@@ -695,6 +697,33 @@ export class ComBattleHandler {
|
||||
return resResult(STATUS.SUCCESS);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 最近组队过的队友列表
|
||||
* @param {} msg
|
||||
* @param {BackendSession} session
|
||||
*/
|
||||
async getRecentTeammates(msg: { }, session: BackendSession) {
|
||||
let roleId = session.get('roleId');
|
||||
|
||||
const teams = await ComBattleTeamModel.getTeamByRoleAndTime(roleId, null, getTodayZeroDate());
|
||||
let roleIdList = new Array<string>();
|
||||
for(let { roleIds } of teams) {
|
||||
for(let r of roleIds) {
|
||||
if(r != roleId) roleIdList.push(r);
|
||||
}
|
||||
}
|
||||
const roles = await RoleModel.findRoleByField('roleId', roleIdList, ROLE_SELECT.SHOW_SIMPLE, true);
|
||||
let result = new Array<FriendParams>();
|
||||
for(let role of roles) {
|
||||
if(role.quitTime == role.loginTime) {
|
||||
let r = new FriendParams(role);
|
||||
result.push(r);
|
||||
}
|
||||
}
|
||||
|
||||
return resResult(STATUS.SUCCESS, { list: result });
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 藏宝图合成
|
||||
* @param {{original: Array<{id: number, count: number}>}} msg
|
||||
|
||||
Reference in New Issue
Block a user