作者 yangfu

排行榜列表修改

... ... @@ -19,6 +19,7 @@ func GetRankList(header *protocol.RequestHeader, request *protocol.GetRankListRe
departments []*models.Department
departmentId int64
hasDepartmentInRank bool = true
currentTotal int
)
if rankRange, err = models.GetRankRangeById(request.RankRangeId); err != nil {
log.Error(err)
... ... @@ -88,6 +89,7 @@ func GetRankList(header *protocol.RequestHeader, request *protocol.GetRankListRe
rsp.Self = append(rsp.Self, *selfRank)
}
if len(ranks) > 0 {
currentTotal = len(ranks)
rsp.Lists = append(rsp.Lists, ranks)
}
}
... ... @@ -100,7 +102,7 @@ func GetRankList(header *protocol.RequestHeader, request *protocol.GetRankListRe
if len(rsp.Lists) > 0 {
lists := make([][]protocol.RankItem, 0)
for i := 0; i < rsp.Total; i++ {
for i := 0; i < currentTotal; i++ {
items := make([]protocol.RankItem, 0)
for j := 0; j < len(itemKeys); j++ {
items = append(items, rsp.Lists[j][i])
... ...