...
|
...
|
@@ -125,6 +125,9 @@ func GetRankType(header *protocol.RequestHeader, request *protocol.GetRankTypeRe |
|
|
var (
|
|
|
lists []*models.RankType
|
|
|
)
|
|
|
rsp = &protocol.GetRankTypeResponse{
|
|
|
List: make([]protocol.NameItem, 0),
|
|
|
}
|
|
|
if lists, err = models.GetRankTypes(header.CompanyId); err != nil {
|
|
|
if err == orm.ErrNoRows {
|
|
|
err = nil
|
...
|
...
|
@@ -133,7 +136,7 @@ func GetRankType(header *protocol.RequestHeader, request *protocol.GetRankTypeRe |
|
|
log.Error(err)
|
|
|
return
|
|
|
}
|
|
|
rsp = &protocol.GetRankTypeResponse{}
|
|
|
|
|
|
for i := range lists {
|
|
|
rsp.List = append(rsp.List, protocol.NameItem{Id: lists[i].Id, Name: lists[i].Name})
|
|
|
}
|
...
|
...
|
@@ -148,6 +151,9 @@ func GetRankRange(header *protocol.RequestHeader, request *protocol.GetRankRange |
|
|
rsp = &protocol.GetRankRangeResponse{
|
|
|
List: make([]protocol.RankRange, 0),
|
|
|
}
|
|
|
if request.RankTypeId == 0 {
|
|
|
return
|
|
|
}
|
|
|
if lists, err = models.GetRankRanges(int(header.CompanyId), request.RankTypeId); err != nil {
|
|
|
if err == orm.ErrNoRows {
|
|
|
err = nil
|
...
|
...
|
@@ -177,6 +183,9 @@ func GetRankPeriods(header *protocol.RequestHeader, request *protocol.GetRankPer |
|
|
lists []*models.RankPeriod
|
|
|
)
|
|
|
rsp = &protocol.GetRankPeriodsResponse{List: make([]protocol.RankPeriod, 0)}
|
|
|
if request.RankTypeId == 0 {
|
|
|
return
|
|
|
}
|
|
|
if lists, err = models.GetRankPeriods(int(header.CompanyId), request.RankTypeId, []int{protocol.RankPeriodBegin, protocol.RankPeriodEnd}); err != nil {
|
|
|
if err == orm.ErrNoRows {
|
|
|
err = nil
|
...
|
...
|
@@ -205,6 +214,9 @@ func GetRankSortItems(header *protocol.RequestHeader, request *protocol.GetRankS |
|
|
rsp = &protocol.GetRankSortItemsResponse{
|
|
|
RankSortItems: make([]protocol.RankSortItem, 0),
|
|
|
}
|
|
|
if request.RankTypeId == 0 {
|
|
|
return
|
|
|
}
|
|
|
if err = models.GetRankItems(header.CompanyId, request.RankTypeId, &sortItems); err != nil {
|
|
|
if err == orm.ErrNoRows {
|
|
|
err = nil
|
...
|
...
|
|