|
@@ -64,7 +64,11 @@ func CalcWinery(opt *PlanOpt, totalAmt, integralTotalAmt float64, userList *LvUs |
|
|
// 累计比例 |
|
|
// 累计比例 |
|
|
accumulateRatioList = ratioList |
|
|
accumulateRatioList = ratioList |
|
|
restAmt = zhios_order_relate_utils.FloatFormat(restAmt, 2) |
|
|
restAmt = zhios_order_relate_utils.FloatFormat(restAmt, 2) |
|
|
|
|
|
|
|
|
|
|
|
teamCountMinData, _ := db.SysCfgGetOne(eg, "team_count_min") |
|
|
|
|
|
teamCountMin := 15 |
|
|
|
|
|
if teamCountMinData != nil { |
|
|
|
|
|
teamCountMin = zhios_order_relate_utils.StrToInt(teamCountMinData.Val) |
|
|
|
|
|
} |
|
|
Loop: |
|
|
Loop: |
|
|
for node.ParentUser != nil { //查找上级用户 |
|
|
for node.ParentUser != nil { //查找上级用户 |
|
|
node.ParentUser.Profit = 0 |
|
|
node.ParentUser.Profit = 0 |
|
@@ -155,7 +159,7 @@ Loop: |
|
|
if node.ParentUser.LevelWeight == maxLevelWeight && count > peerNum { |
|
|
if node.ParentUser.LevelWeight == maxLevelWeight && count > peerNum { |
|
|
if peerNum >= 1 && node.ParentUser.Lv >= 2 { |
|
|
if peerNum >= 1 && node.ParentUser.Lv >= 2 { |
|
|
teamtotal := db.GetUserTeamTotal(eg, zhios_order_relate_utils.IntToStr(node.ParentUser.Uid)) |
|
|
teamtotal := db.GetUserTeamTotal(eg, zhios_order_relate_utils.IntToStr(node.ParentUser.Uid)) |
|
|
if teamtotal == nil || teamtotal != nil && teamtotal.TeamCount < 15 { |
|
|
|
|
|
|
|
|
if teamtotal == nil || teamtotal != nil && teamtotal.TeamCount < teamCountMin { |
|
|
sql1 := `SELECT ur.uid,up.parent_uid,ur.level FROM user_relate ur |
|
|
sql1 := `SELECT ur.uid,up.parent_uid,ur.level FROM user_relate ur |
|
|
LEFT JOIN user_profile up on ur.uid=up.uid |
|
|
LEFT JOIN user_profile up on ur.uid=up.uid |
|
|
LEFT JOIN user u on u.uid=ur.uid |
|
|
LEFT JOIN user u on u.uid=ur.uid |
|
@@ -166,7 +170,7 @@ Loop: |
|
|
var nMap = make(map[string][]string) |
|
|
var nMap = make(map[string][]string) |
|
|
nCount := 0 |
|
|
nCount := 0 |
|
|
for _, v := range nativeString1 { |
|
|
for _, v := range nativeString1 { |
|
|
if zhios_order_relate_utils.StrToInt(v["uid"]) == 0 || nCount > 15 { |
|
|
|
|
|
|
|
|
if zhios_order_relate_utils.StrToInt(v["uid"]) == 0 || nCount >= teamCountMin { |
|
|
continue |
|
|
continue |
|
|
} |
|
|
} |
|
|
if v["level"] == "1" && len(nMap[v["level"]]) < 2 { |
|
|
if v["level"] == "1" && len(nMap[v["level"]]) < 2 { |
|
@@ -186,7 +190,7 @@ Loop: |
|
|
teamtotal.TeamCount = nCount |
|
|
teamtotal.TeamCount = nCount |
|
|
eg.Where("uid=?", node.ParentUser.Uid).Update(teamtotal) |
|
|
eg.Where("uid=?", node.ParentUser.Uid).Update(teamtotal) |
|
|
} |
|
|
} |
|
|
if nCount < 15 { |
|
|
|
|
|
|
|
|
if nCount < teamCountMin { |
|
|
node.ParentUser.IsFreeze = 1 |
|
|
node.ParentUser.IsFreeze = 1 |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|