(ctx context.Context, startTime, endTime time.Time, limit int, userIDExist map[string]bool)
| 896 | } |
| 897 | |
| 898 | func (us *UserService) getActivityUserVoteStat(ctx context.Context, startTime, endTime time.Time, limit int, |
| 899 | userIDExist map[string]bool) (voteStat []*entity.ActivityUserVoteStat, userIDs []string, err error) { |
| 900 | if plugin.RankAgentEnabled() { |
| 901 | return make([]*entity.ActivityUserVoteStat, 0), make([]string, 0), nil |
| 902 | } |
| 903 | voteStat, err = us.activityRepo.GetUsersWhoHasVoteMost(ctx, startTime, endTime, limit) |
| 904 | if err != nil { |
| 905 | return nil, nil, err |
| 906 | } |
| 907 | for _, stat := range voteStat { |
| 908 | if stat.VoteCount <= 0 { |
| 909 | continue |
| 910 | } |
| 911 | if userIDExist[stat.UserID] { |
| 912 | continue |
| 913 | } |
| 914 | userIDs = append(userIDs, stat.UserID) |
| 915 | userIDExist[stat.UserID] = true |
| 916 | } |
| 917 | return voteStat, userIDs, nil |
| 918 | } |
| 919 | |
| 920 | func (us *UserService) getStaff(ctx context.Context, userIDExist map[string]bool) ( |
| 921 | userRoleRels []*entity.UserRoleRel, userIDs []string, err error) { |
no test coverage detected