瀏覽代碼

update

master
dengbiao 5 月之前
父節點
當前提交
0a063672ff
共有 1 個檔案被更改,包括 7 行新增1 行删除
  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 查看文件

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



Loading…
取消
儲存