好友:fix 推荐列表数量少时无法获取
This commit is contained in:
@@ -49,6 +49,7 @@ export class FriendHandler {
|
||||
let otherServerList = new Array<FriendRecommendParams>();
|
||||
for(let role of allList) {
|
||||
let type = getRecommendType(myFriendRelation, roleId, role.roleId);
|
||||
console.log('****', type, roleId, role.roleId)
|
||||
if(type == FRIEND_RELATION_TYPE.NORMAL) {
|
||||
let param = new FriendRecommendParams(role);
|
||||
param.setType(type);
|
||||
@@ -74,7 +75,11 @@ export class FriendHandler {
|
||||
let list2:FriendRecommendParams[] = getRandEelm(otherServerList, otherServerLen);
|
||||
|
||||
if(list2.length < FRIEND.FRIEND_RECONMMEND_NUM - myServerLen) {
|
||||
list1 = getRandEelm(myServerList, FRIEND.FRIEND_RECONMMEND_NUM - list2.length);
|
||||
if(myServerList.length <= FRIEND.FRIEND_RECONMMEND_NUM - list2.length) {
|
||||
list1 = myServerList;
|
||||
} else {
|
||||
list1 = getRandEelm(myServerList, FRIEND.FRIEND_RECONMMEND_NUM - list2.length);
|
||||
}
|
||||
}
|
||||
|
||||
let list = list1.concat(list2);
|
||||
|
||||
Reference in New Issue
Block a user