Bläddra i källkod

Merge remote-tracking branch 'origin/master'

master
huangjiajun 6 månader sedan
förälder
incheckning
e995b0d1a9
1 ändrade filer med 7 tillägg och 1 borttagningar
  1. +7
    -1
      rule/one_circles/one_circles_available_green_energy_settlement.go

+ 7
- 1
rule/one_circles/one_circles_available_green_energy_settlement.go Visa fil

@@ -122,9 +122,15 @@ func CalcPriceReductionFormula(engine *xorm.Engine, userExchangeNumsValue string
}
priceHigherThanValue, _ := decimal.NewFromString(priceSettingStruct.PriceHigherThanValue)
if nowPrice.Cmp(priceHigherThanValue) == 1 {
err = errors.New("当前价格异常,请稍后重新兑换")
err = errors.New("当前价格异常过高,请稍后重新兑换")
return
}
priceBelowValue, _ := decimal.NewFromString(priceSettingStruct.PriceBelowValue)
if nowPrice.Cmp(priceBelowValue) == -1 {
err = errors.New("当前价格异常过低,请稍后重新兑换")
return
}

originalQuantityFunds, _ := decimal.NewFromString(oneCirclesGreenEnergyBasicSetting.OriginalFunds) //原始资金
afterPrice := originalQuantityFunds.Div(userExchangeNums.Add(originalQuantityNums)) //降价后的价格



Laddar…
Avbryt
Spara