Browse Source

update 一个圈圈

master
DengBiao 10 months ago
parent
commit
292d64b4b3
1 changed files with 14 additions and 1 deletions
  1. +14
    -1
      rule/public_platoon_double_network_relate_commission.go

+ 14
- 1
rule/public_platoon_double_network_relate_commission.go View File

@@ -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, &times)
level = makeSearchLevelDoubleNetworkByPosition(&rank, rows, &times)
levelPosition1 := getLevelForFirstPositionDoubleNetwork(level, userPublicPlatoonDoubleNetworkSetting.SeveralTimes)
levelRank = rank - levelPosition1 + 1



Loading…
Cancel
Save