From 619b8983226622110a52a6b96645bb7096f480f1 Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Mon, 29 Jan 2024 17:33:38 +0800 Subject: [PATCH] update --- ...rcles_activity_coin_auto_exchange_green_energy.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rule/one_circles/one_circles_activity_coin_auto_exchange_green_energy.go b/rule/one_circles/one_circles_activity_coin_auto_exchange_green_energy.go index 1521c53..c30c31e 100644 --- a/rule/one_circles/one_circles_activity_coin_auto_exchange_green_energy.go +++ b/rule/one_circles/one_circles_activity_coin_auto_exchange_green_energy.go @@ -75,9 +75,9 @@ func ActivityCoinAutoExchangeGreenEnergy(engine *xorm.Engine, masterId string) ( session := engine.NewSession() //4、处理"个人活跃积分"兑换 - autoExchangeNumsByPersonValue := decimal.NewFromFloat(autoExchangeNumsByPerson) - autoExchangeNumsByPersonAmount := autoExchangeNumsByPersonValue.Div(personActivePointsCoinExchangeRatioValue).String() for _, v := range list1 { + autoExchangeNumsByPersonValue, _ := decimal.NewFromString(v.Amount) + autoExchangeNumsByPersonAmount := autoExchangeNumsByPersonValue.Div(personActivePointsCoinExchangeRatioValue).String() //4.1计算涨价公式 err1, values, _, afterPriceValue := NewCalcPriceIncreaseFormula(autoExchangeNumsByPersonAmount, oneCirclesGreenEnergyBasicSetting) if err1 != nil { @@ -106,7 +106,7 @@ func ActivityCoinAutoExchangeGreenEnergy(engine *xorm.Engine, masterId string) ( OrdId: "", CoinId: oneCirclesPublicPlatoonBasicSetting.PersonActivePointsCoinId, Uid: v.Uid, - Amount: autoExchangeNumsByPerson, + Amount: zhios_order_relate_utils.StrToFloat64(v.Amount), }) if err != nil { _ = session.Rollback() @@ -124,9 +124,9 @@ func ActivityCoinAutoExchangeGreenEnergy(engine *xorm.Engine, masterId string) ( } //5、处理"团队活跃积分"兑换 - autoExchangeNumsByTeamValue := decimal.NewFromFloat(autoExchangeNumsByTeam) - autoExchangeNumsByTeamAmount := autoExchangeNumsByTeamValue.Div(teamActivePointsCoinExchangeRatioValue).String() for _, v := range list2 { + autoExchangeNumsByTeamValue, _ := decimal.NewFromString(v.Amount) + autoExchangeNumsByTeamAmount := autoExchangeNumsByTeamValue.Div(teamActivePointsCoinExchangeRatioValue).String() //5.1计算涨价公式 err1, values, _, afterPriceValue := NewCalcPriceIncreaseFormula(autoExchangeNumsByTeamAmount, oneCirclesGreenEnergyBasicSetting) if err1 != nil { @@ -155,7 +155,7 @@ func ActivityCoinAutoExchangeGreenEnergy(engine *xorm.Engine, masterId string) ( OrdId: "", CoinId: oneCirclesPublicPlatoonBasicSetting.TeamActivePointsCoinId, Uid: v.Uid, - Amount: autoExchangeNumsByTeam, + Amount: zhios_order_relate_utils.StrToFloat64(v.Amount), }) if err != nil { _ = session.Rollback()