Pārlūkot izejas kodu

update 一个圈圈

master
DengBiao pirms 10 mēnešiem
vecāks
revīzija
292d64b4b3
1 mainītis faili ar 14 papildinājumiem un 1 dzēšanām
  1. +14
    -1
      rule/public_platoon_double_network_relate_commission.go

+ 14
- 1
rule/public_platoon_double_network_relate_commission.go Parādīt failu

@@ -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



Notiek ielāde…
Atcelt
Saglabāt