fix(user): remove deleted user from ranking
This commit is contained in:
@@ -870,7 +870,7 @@ func (us *UserService) warpStatRankingResp(
|
||||
if stat.Rank <= 0 {
|
||||
continue
|
||||
}
|
||||
if userInfo := userInfoMapping[stat.UserID]; userInfo != nil {
|
||||
if userInfo := userInfoMapping[stat.UserID]; userInfo != nil && userInfo.Status != entity.UserStatusDeleted {
|
||||
resp.UsersWithTheMostReputation = append(resp.UsersWithTheMostReputation, &schema.UserRankingSimpleInfo{
|
||||
Username: userInfo.Username,
|
||||
Rank: stat.Rank,
|
||||
@@ -883,7 +883,7 @@ func (us *UserService) warpStatRankingResp(
|
||||
if stat.VoteCount <= 0 {
|
||||
continue
|
||||
}
|
||||
if userInfo := userInfoMapping[stat.UserID]; userInfo != nil {
|
||||
if userInfo := userInfoMapping[stat.UserID]; userInfo != nil && userInfo.Status != entity.UserStatusDeleted {
|
||||
resp.UsersWithTheMostVote = append(resp.UsersWithTheMostVote, &schema.UserRankingSimpleInfo{
|
||||
Username: userInfo.Username,
|
||||
VoteCount: stat.VoteCount,
|
||||
@@ -893,7 +893,7 @@ func (us *UserService) warpStatRankingResp(
|
||||
}
|
||||
}
|
||||
for _, rel := range userRoleRels {
|
||||
if userInfo := userInfoMapping[rel.UserID]; userInfo != nil {
|
||||
if userInfo := userInfoMapping[rel.UserID]; userInfo != nil && userInfo.Status != entity.UserStatusDeleted {
|
||||
resp.Staffs = append(resp.Staffs, &schema.UserRankingSimpleInfo{
|
||||
Username: userInfo.Username,
|
||||
Rank: userInfo.Rank,
|
||||
|
||||
Reference in New Issue
Block a user