dengbiao vor 5 Monaten
Ursprung
Commit
0a063672ff
1 geänderte Dateien mit 7 neuen und 1 gelöschten Zeilen
  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 Datei anzeigen

@@ -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)) //降价后的价格



Laden…
Abbrechen
Speichern