Browse Source

更新

tags/v4.3.1
huangjiajun 1 year ago
parent
commit
faa97d8cad
1 changed files with 10 additions and 3 deletions
  1. +10
    -3
      lib/comm_plan/winery_adv.go

+ 10
- 3
lib/comm_plan/winery_adv.go View File

@@ -158,19 +158,25 @@ func CalcAdv(opt *PlanOpt, totalAmt, integralTotalAmt float64, userList *LvUser,
maxLv = node.Lv // 当前等级
maxLevelWeight = node.LevelWeight // 当前权重
peerNum = 0 // 存在同级数
isFirst = 0
)

Loop:
for node.ParentUser != nil { //查找上级用户
node.ParentUser.Profit = 0
count := len(grade[maxLv].PeerRate)
if grade[maxLv].PeerRateList != nil {
if grade[maxLv].NewPeerList != nil {
count = len(grade[maxLv].PeerRateList)
}
var isBreak bool
zeroList := make(map[string]struct{})
if node.ParentUser.Diff == 1 {
if node.ParentUser.Lv == 0 {
node.ParentUser.LastProfitList = node.LastProfitList
node.ParentUser.LastProfit = node.LastProfit
node = node.ParentUser
continue
}
if isFirst == 0 {
userType := "to_extend"
commission, _, amountList, _ := CalReturnAmountAndRatioWineryAdv(node.ParentUser.Lv, userList.OwnbuyReturnType, peerNum, userType, totalAmt, integralTotalAmt, opt)
node.ParentUser.Profit = commission
@@ -183,6 +189,7 @@ Loop:
node.ParentUser.LastProfit = node.ParentUser.Profit
// 等级往上升则置0
maxLevelWeight, maxLv, peerNum = node.ParentUser.LevelWeight, node.ParentUser.Lv, 0
isFirst = 1
} else {
// 同级奖
if node.ParentUser.LevelWeight == maxLevelWeight && count > peerNum {


Loading…
Cancel
Save