diff --git a/lib/comm_plan/winery_adv.go b/lib/comm_plan/winery_adv.go index 4ebd7a5..29a8e67 100644 --- a/lib/comm_plan/winery_adv.go +++ b/lib/comm_plan/winery_adv.go @@ -168,7 +168,7 @@ Loop: node.ParentUser.Profit = 0 count := len(grade[maxLv].PeerRate) if grade[maxLv].NewPeerList != nil { - count = len(grade[maxLv].PeerRateList) + count = len(grade[maxLv].NewPeerList) } var isBreak bool zeroList := make(map[string]struct{}) @@ -414,8 +414,10 @@ func getVirtualCoinRatioWineryAdv(typ string, level, peerNum int, grade map[int] ok := false switch typ { case "same_lv": - ratio, ok = grade[level].PeerRateList[peerNum][coinId] - ratio = zhios_order_relate_utils.Float64ToStrByPrec(zhios_order_relate_utils.StrToFloat64(ratio)/100, 4) + if grade[level].NewPeerList != nil && len(grade[level].NewPeerList) > 0 { + ratio, ok = grade[level].NewPeerList[peerNum][coinId] + ratio = zhios_order_relate_utils.Float64ToStrByPrec(zhios_order_relate_utils.StrToFloat64(ratio)/100, 4) + } case "to_extend": ratio, ok = grade[level].ToExtendList[coinId] ratio = zhios_order_relate_utils.Float64ToStrByPrec(zhios_order_relate_utils.StrToFloat64(ratio)/100, 4)