|
|
package rank
|
|
|
|
|
|
import (
|
|
|
"fmt"
|
|
|
"github.com/astaxie/beego/orm"
|
|
|
"gitlab.fjmaimaimai.com/mmm-go/gocomm/pkg/log"
|
|
|
"opp/models"
|
...
|
...
|
@@ -11,10 +12,12 @@ import ( |
|
|
//排行榜
|
|
|
func GetRankList(header *protocol.RequestHeader, request *protocol.GetRankListRequest) (rsp *protocol.GetRankListResponse, err error) {
|
|
|
var (
|
|
|
ranks []protocol.RankItem
|
|
|
selfRank *protocol.RankItem
|
|
|
rankRange *models.RankRange
|
|
|
itemKeys []string
|
|
|
ranks []protocol.RankItem
|
|
|
selfRank *protocol.RankItem
|
|
|
rankType *models.RankType
|
|
|
rankRange *models.RankRange
|
|
|
rankPeriod *models.RankPeriod
|
|
|
itemKeys []string
|
|
|
//itemNames []string
|
|
|
departments []*models.Department
|
|
|
departmentId int64
|
...
|
...
|
@@ -29,6 +32,20 @@ func GetRankList(header *protocol.RequestHeader, request *protocol.GetRankListRe |
|
|
log.Error(err)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
{
|
|
|
//测试日志
|
|
|
if rankType, err = models.GetRankTypeById(request.RankTypeId); err != nil {
|
|
|
log.Error(err)
|
|
|
return
|
|
|
}
|
|
|
if rankPeriod, err = models.GetRankPeriodById((request.RankPeriodId)); err != nil {
|
|
|
log.Error(err)
|
|
|
return
|
|
|
}
|
|
|
log.Debug(fmt.Sprintf("用户:%v 获取排行榜 :%v %v %v", header.UserId, rankType.Name, rankRange.Name, rankPeriod.SeasonName))
|
|
|
}
|
|
|
|
|
|
itemKeys = request.SortItemKeys
|
|
|
if len(itemKeys) == 0 {
|
|
|
if itemKeys, _, err = models.GetRankItemKeys(header.CompanyId, request.RankTypeId); err != nil && err != orm.ErrNoRows {
|
...
|
...
|
|