|
@@ -65,11 +65,11 @@ func CalcPriceReductionFormula(engine *xorm.Engine, userExchangeNumsValue string |
|
|
afterPrice := originalQuantityFunds.Div(userExchangeNums.Add(originalQuantityNums)) //降价后的价格 |
|
|
afterPrice := originalQuantityFunds.Div(userExchangeNums.Add(originalQuantityNums)) //降价后的价格 |
|
|
|
|
|
|
|
|
greenEnergyValues := userExchangeNums.Mul(afterPrice) //绿色能量个数 |
|
|
greenEnergyValues := userExchangeNums.Mul(afterPrice) //绿色能量个数 |
|
|
greenEnergyFeeValues := greenEnergyValues.Mul(exchangeAccountBalanceFee.Div(decimalRate)) //绿色能量个数扣除手续费 |
|
|
|
|
|
|
|
|
greenEnergyFeeValues := greenEnergyValues.Mul(exchangeAccountBalanceFee.Div(decimalRate)) //绿色能量个数扣除手续费价值 |
|
|
|
|
|
|
|
|
values = greenEnergyValues.Sub(greenEnergyFeeValues).Truncate(8).String() //扣除用户绿色能量个数 |
|
|
|
|
|
greenEnergy = greenEnergyValues.Truncate(8).String() |
|
|
|
|
|
greenEnergyFee = greenEnergyFeeValues.Truncate(8).String() |
|
|
|
|
|
|
|
|
values = greenEnergyValues.Sub(greenEnergyFeeValues).Truncate(8).String() //用户实际得到的钱 |
|
|
|
|
|
greenEnergy = greenEnergyValues.Truncate(8).String() //原本兑换到的钱 |
|
|
|
|
|
greenEnergyFee = userExchangeNums.Mul(exchangeAccountBalanceFee.Div(decimalRate)).Truncate(8).String() //绿色能量手续费 |
|
|
nowPriceValue = nowPrice.String() |
|
|
nowPriceValue = nowPrice.String() |
|
|
afterPriceValue = afterPrice.String() |
|
|
afterPriceValue = afterPrice.String() |
|
|
return |
|
|
return |
|
|