|
|
@@ -220,17 +220,28 @@ func GetRewardCommission(engine *xorm.Engine, rmd *md.CommissionParam, isShare b |
|
|
|
if ulink == nil { |
|
|
|
return 0, 0, 0, 0, nil, nil |
|
|
|
} |
|
|
|
comm(commArr, ulink) |
|
|
|
return ulink.Profit, pvdFee, sysFee, subsidyFee, ulink, nil |
|
|
|
} |
|
|
|
func comm(commArr map[string]string, ulink *comm_plan.LvUser) *comm_plan.LvUser { |
|
|
|
if zhios_order_relate_utils.StrToFloat64(commArr["integralRewardMultiple"]) > 0 { |
|
|
|
for k, v := range ulink.OwnSubsidyFeeList { |
|
|
|
ulink.OwnSubsidyFeeList[k] = v * zhios_order_relate_utils.StrToFloat64(commArr["integralRewardMultiple"]) |
|
|
|
if k == commArr["integralCoinId"] && zhios_order_relate_utils.StrToInt(k) > 0 { |
|
|
|
ulink.OwnSubsidyFeeList[k] = v * zhios_order_relate_utils.StrToFloat64(commArr["integralRewardMultiple"]) |
|
|
|
} |
|
|
|
} |
|
|
|
for k, v := range ulink.ProfitList { |
|
|
|
ulink.ProfitList[k].Val = v.Val * zhios_order_relate_utils.StrToFloat64(commArr["integralRewardMultiple"]) |
|
|
|
if v.Cid == commArr["integralCoinId"] && zhios_order_relate_utils.StrToInt(v.Cid) > 0 { |
|
|
|
ulink.ProfitList[k].Val = v.Val * zhios_order_relate_utils.StrToFloat64(commArr["integralRewardMultiple"]) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return ulink.Profit, pvdFee, sysFee, subsidyFee, ulink, nil |
|
|
|
if ulink.ParentUser != nil { |
|
|
|
ulink.ParentUser = comm(commArr, ulink.ParentUser) |
|
|
|
} |
|
|
|
return ulink |
|
|
|
} |
|
|
|
|
|
|
|
func getRewardLink(uid string, diff int, reward map[string]string, ulinkParent *comm_plan.LvUser, types string, cfg *comm_plan.PlanOpt) *comm_plan.LvUser { |
|
|
|
var SubsidyFee = zhios_order_relate_utils.StrToFloat64(reward["0"]) |
|
|
|
var SubsidyFeeList = make([]*comm_plan.VirtualCoinCommission, 0) |
|
|
|