|
@@ -74,28 +74,27 @@ func GetRankList(header *protocol.RequestHeader, request *protocol.GetRankListRe |
|
@@ -74,28 +74,27 @@ func GetRankList(header *protocol.RequestHeader, request *protocol.GetRankListRe |
74
|
log.Error(err)
|
74
|
log.Error(err)
|
75
|
return
|
75
|
return
|
76
|
}
|
76
|
}
|
77
|
- if !hasDepartmentInRank {
|
|
|
78
|
- continue
|
|
|
79
|
- }
|
|
|
80
|
- if departmentId > 0 {
|
|
|
81
|
- if err = models.GetRanksByDepartmentSelf(header.CompanyId, request.RankTypeId, request.RankRangeId, request.RankPeriodId, key, departmentId, &selfRank); err != nil {
|
|
|
82
|
- log.Error(err)
|
|
|
83
|
- return
|
|
|
84
|
- }
|
|
|
85
|
- } else if hasDepartmentInRank {
|
|
|
86
|
- for i := range departments {
|
|
|
87
|
- d := departments[i]
|
|
|
88
|
- if err = models.GetRanksByDepartmentSelf(header.CompanyId, request.RankTypeId, request.RankRangeId, request.RankPeriodId, key, int64(d.Id), &selfRank); err != nil {
|
77
|
+ if hasDepartmentInRank {
|
|
|
78
|
+ if departmentId > 0 {
|
|
|
79
|
+ if err = models.GetRanksByDepartmentSelf(header.CompanyId, request.RankTypeId, request.RankRangeId, request.RankPeriodId, key, departmentId, &selfRank); err != nil {
|
89
|
log.Error(err)
|
80
|
log.Error(err)
|
90
|
return
|
81
|
return
|
91
|
}
|
82
|
}
|
92
|
- if selfRank != nil {
|
|
|
93
|
- departmentId = int64(d.Id)
|
|
|
94
|
- break
|
83
|
+ } else if hasDepartmentInRank {
|
|
|
84
|
+ for i := range departments {
|
|
|
85
|
+ d := departments[i]
|
|
|
86
|
+ if err = models.GetRanksByDepartmentSelf(header.CompanyId, request.RankTypeId, request.RankRangeId, request.RankPeriodId, key, int64(d.Id), &selfRank); err != nil {
|
|
|
87
|
+ log.Error(err)
|
|
|
88
|
+ return
|
|
|
89
|
+ }
|
|
|
90
|
+ if selfRank != nil {
|
|
|
91
|
+ departmentId = int64(d.Id)
|
|
|
92
|
+ break
|
|
|
93
|
+ }
|
|
|
94
|
+ }
|
|
|
95
|
+ if departmentId == 0 {
|
|
|
96
|
+ hasDepartmentInRank = false
|
95
|
}
|
97
|
}
|
96
|
- }
|
|
|
97
|
- if departmentId == 0 {
|
|
|
98
|
- hasDepartmentInRank = false
|
|
|
99
|
}
|
98
|
}
|
100
|
}
|
99
|
}
|
101
|
} else if rankRange.Type == protocol.RankRangeTypeAllCompanyUser || rankRange.Type == protocol.RankRangeTypeSpecifyUser {
|
100
|
} else if rankRange.Type == protocol.RankRangeTypeAllCompanyUser || rankRange.Type == protocol.RankRangeTypeSpecifyUser {
|