...
|
...
|
@@ -74,28 +74,27 @@ func GetRankList(header *protocol.RequestHeader, request *protocol.GetRankListRe |
|
|
log.Error(err)
|
|
|
return
|
|
|
}
|
|
|
if !hasDepartmentInRank {
|
|
|
continue
|
|
|
}
|
|
|
if departmentId > 0 {
|
|
|
if err = models.GetRanksByDepartmentSelf(header.CompanyId, request.RankTypeId, request.RankRangeId, request.RankPeriodId, key, departmentId, &selfRank); err != nil {
|
|
|
log.Error(err)
|
|
|
return
|
|
|
}
|
|
|
} else if hasDepartmentInRank {
|
|
|
for i := range departments {
|
|
|
d := departments[i]
|
|
|
if err = models.GetRanksByDepartmentSelf(header.CompanyId, request.RankTypeId, request.RankRangeId, request.RankPeriodId, key, int64(d.Id), &selfRank); err != nil {
|
|
|
if hasDepartmentInRank {
|
|
|
if departmentId > 0 {
|
|
|
if err = models.GetRanksByDepartmentSelf(header.CompanyId, request.RankTypeId, request.RankRangeId, request.RankPeriodId, key, departmentId, &selfRank); err != nil {
|
|
|
log.Error(err)
|
|
|
return
|
|
|
}
|
|
|
if selfRank != nil {
|
|
|
departmentId = int64(d.Id)
|
|
|
break
|
|
|
} else if hasDepartmentInRank {
|
|
|
for i := range departments {
|
|
|
d := departments[i]
|
|
|
if err = models.GetRanksByDepartmentSelf(header.CompanyId, request.RankTypeId, request.RankRangeId, request.RankPeriodId, key, int64(d.Id), &selfRank); err != nil {
|
|
|
log.Error(err)
|
|
|
return
|
|
|
}
|
|
|
if selfRank != nil {
|
|
|
departmentId = int64(d.Id)
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
if departmentId == 0 {
|
|
|
hasDepartmentInRank = false
|
|
|
}
|
|
|
}
|
|
|
if departmentId == 0 {
|
|
|
hasDepartmentInRank = false
|
|
|
}
|
|
|
}
|
|
|
} else if rankRange.Type == protocol.RankRangeTypeAllCompanyUser || rankRange.Type == protocol.RankRangeTypeSpecifyUser {
|
...
|
...
|
|