...
|
...
|
@@ -25,10 +25,13 @@ func GetRankList(header *protocol.RequestHeader, request *protocol.GetRankListRe |
|
|
log.Error(err)
|
|
|
return
|
|
|
}
|
|
|
itemKeys = request.SortItemKeys
|
|
|
if len(itemKeys) == 0 {
|
|
|
if itemKeys, itemNames, err = models.GetRankItemKeys(header.CompanyId, request.RankTypeId); err != nil && err != orm.ErrNoRows {
|
|
|
log.Error(err)
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
rsp = &protocol.GetRankListResponse{
|
|
|
Self: make([]protocol.RankItem, 0),
|
|
|
Lists: make([][]protocol.RankItem, 0),
|
...
|
...
|
@@ -191,6 +194,28 @@ func GetRankPeriods(header *protocol.RequestHeader, request *protocol.GetRankPer |
|
|
return
|
|
|
}
|
|
|
|
|
|
//获取排行榜评比项
|
|
|
func GetRankSortItems(header *protocol.RequestHeader, request *protocol.GetRankSortItemsRequest) (rsp *protocol.GetRankSortItemsResponse, err error) {
|
|
|
var (
|
|
|
sortItems []protocol.RankSortItem
|
|
|
)
|
|
|
rsp = &protocol.GetRankSortItemsResponse{
|
|
|
RankSortItems: make([]protocol.RankSortItem, 0),
|
|
|
}
|
|
|
if err = models.GetRankItems(header.CompanyId, request.RankTypeId, &sortItems); err != nil {
|
|
|
if err == orm.ErrNoRows {
|
|
|
err = nil
|
|
|
return
|
|
|
}
|
|
|
log.Error(err)
|
|
|
return
|
|
|
}
|
|
|
if len(sortItems) > 0 {
|
|
|
rsp.RankSortItems = sortItems
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
|
|
|
//手动计算排行榜
|
|
|
func ComputeRankScore(header *protocol.RequestHeader, request *protocol.ComputeRankScoreRequest) (rsp *protocol.ComputeRankScoreResponse, err error) {
|
|
|
var ()
|
...
|
...
|
|