|
|
@@ -77,13 +77,15 @@ func HandleSubCommissionDistributionSystem(engine *xorm.Engine, args *md.Regiona |
|
|
|
} |
|
|
|
|
|
|
|
//查询 virtual_coin 获取虚拟货币的 “兑换比例” |
|
|
|
virtualCoin, err := db.VirtualCoinFindByParams(engine, map[string]interface{}{}) |
|
|
|
virtualCoin, err := db.VirtualCoinFindByAll(engine) |
|
|
|
if err != nil { |
|
|
|
return nil, false |
|
|
|
} |
|
|
|
var virtualCoinMap = map[int]string{} |
|
|
|
for _, v := range *virtualCoin { |
|
|
|
virtualCoinMap[v.Id] = v.ExchangeRatio |
|
|
|
if virtualCoin != nil { |
|
|
|
for _, v := range *virtualCoin { |
|
|
|
virtualCoinMap[v.Id] = v.ExchangeRatio |
|
|
|
} |
|
|
|
} |
|
|
|
//查询代理网点的代理(网点、区、市、省)信息 |
|
|
|
var parents, tempParents []map[string]interface{} |
|
|
@@ -265,17 +267,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 |
|
|
|