diff --git a/rule/regional_agent.go b/rule/regional_agent.go index 21bd146..315b81f 100644 --- a/rule/regional_agent.go +++ b/rule/regional_agent.go @@ -301,17 +301,17 @@ func CommAmount(CommissionRate float64, amount float64, agentUser *[]model.Regio } else { temp["divide_amount"] = everyPersonDivideAmount var coinSetDetailMap []map[string]interface{} - for _, v := range coinSetDetail { + for _, v1 := range coinSetDetail { var exchangeRatio float64 - if zhios_order_relate_utils.AnyToFloat64(virtualCoin[v.CoinID]) != 0 { - exchangeRatio = zhios_order_relate_utils.AnyToFloat64(virtualCoin[v.CoinID]) + if zhios_order_relate_utils.AnyToFloat64(virtualCoin[v1.CoinID]) != 0 { + exchangeRatio = zhios_order_relate_utils.AnyToFloat64(virtualCoin[v1.CoinID]) } else { exchangeRatio = 0 } coinSetDetailMap = append(coinSetDetailMap, map[string]interface{}{ - "coin_id": v.CoinID, - "coin_name": v.CoinName, - "divide_value": zhios_order_relate_utils.AnyToFloat64(temp["divide_amount"]) * (zhios_order_relate_utils.AnyToFloat64(v.Value) / 100) * exchangeRatio, + "coin_id": v1.CoinID, + "coin_name": v1.CoinName, + "divide_value": zhios_order_relate_utils.AnyToFloat64(temp["divide_amount"]) * (zhios_order_relate_utils.AnyToFloat64(v1.Value) / 100) * exchangeRatio, }) } temp["divide_virtual_currency"] = coinSetDetailMap diff --git a/rule/regional_sub_agent.go b/rule/regional_sub_agent.go index 5b83324..8319f35 100644 --- a/rule/regional_sub_agent.go +++ b/rule/regional_sub_agent.go @@ -265,17 +265,17 @@ func SubCommAmount(parentUid int, CommissionRate float64, amount float64, agentU } else { temp["divide_amount"] = everyPersonDivideAmount var coinSetDetailMap []map[string]interface{} - for _, v := range coinSetDetail { + for _, v1 := range coinSetDetail { var exchangeRatio float64 - if zhios_order_relate_utils.AnyToFloat64(virtualCoin[v.CoinID]) != 0 { - exchangeRatio = zhios_order_relate_utils.AnyToFloat64(virtualCoin[v.CoinID]) + if zhios_order_relate_utils.AnyToFloat64(virtualCoin[v1.CoinID]) != 0 { + exchangeRatio = zhios_order_relate_utils.AnyToFloat64(virtualCoin[v1.CoinID]) } else { exchangeRatio = 0 } coinSetDetailMap = append(coinSetDetailMap, map[string]interface{}{ - "coin_id": v.CoinID, - "coin_name": v.CoinName, - "divide_value": zhios_order_relate_utils.AnyToFloat64(temp["divide_amount"]) * (zhios_order_relate_utils.AnyToFloat64(v.Value) / 100) * exchangeRatio, + "coin_id": v1.CoinID, + "coin_name": v1.CoinName, + "divide_value": zhios_order_relate_utils.AnyToFloat64(temp["divide_amount"]) * (zhios_order_relate_utils.AnyToFloat64(v1.Value) / 100) * exchangeRatio, }) } temp["divide_virtual_currency"] = coinSetDetailMap