|
|
@@ -192,6 +192,19 @@ func makeSearchLevelDoubleNetwork(position *int, rows float64, times *float64) ( |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//递归查找等级 |
|
|
|
func makeSearchLevelDoubleNetworkByPosition(position *int, rows float64, times *float64) (level int) { |
|
|
|
for { |
|
|
|
level++ |
|
|
|
positionStart := getLevelForFirstPositionDoubleNetwork(level, int(*times)) |
|
|
|
positionEnd := getLevelForLastPositionDoubleNetwork(level, int(*times)) |
|
|
|
if positionStart <= *position && *position <= positionEnd { |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//查找归属父级id |
|
|
|
func makeSearchPidDoubleNetwork(position int, row int) (pid int) { |
|
|
|
divisionValue := (position - 1) / row |
|
|
@@ -373,7 +386,7 @@ func EstimateUserPosition(engine *xorm.Engine, uid int) (total, level, levelRank |
|
|
|
} |
|
|
|
rows := float64(userPublicPlatoonDoubleNetworkSetting.SeveralRows) |
|
|
|
times := float64(userPublicPlatoonDoubleNetworkSetting.SeveralTimes) |
|
|
|
level = makeSearchLevelDoubleNetwork(&rank, rows, ×) |
|
|
|
level = makeSearchLevelDoubleNetworkByPosition(&rank, rows, ×) |
|
|
|
levelPosition1 := getLevelForFirstPositionDoubleNetwork(level, userPublicPlatoonDoubleNetworkSetting.SeveralTimes) |
|
|
|
levelRank = rank - levelPosition1 + 1 |
|
|
|
|
|
|
|