|
|
@@ -163,9 +163,12 @@ func DailySettlementBlockConsumeIntegral(engine *xorm.Engine, mid string, isTask |
|
|
|
func calcNowEverydayConsumeIntegral(subsidyBase *model.SubsidyBase, hasConsumeTotal int64) (value float64, err error) { |
|
|
|
consumptionMoney, _ := decimal.NewFromString(subsidyBase.ConsumptionTotalMoney) |
|
|
|
baseSubsidyMoney, _ := decimal.NewFromString(subsidyBase.BaseSubsidyMoney) |
|
|
|
floatSubsidyOpen := decimal.NewFromInt(int64(subsidyBase.FloatSubsidyOpen) / 10000) |
|
|
|
if subsidyBase.FloatSubsidyOpen == 0 { //没有浮动补贴情况 |
|
|
|
subsidyBase.FloatSubsidyBili = 0 |
|
|
|
} |
|
|
|
floatSubsidyBili := decimal.NewFromInt(int64(subsidyBase.FloatSubsidyBili) / 10000) |
|
|
|
consumeTotal := decimal.NewFromInt(hasConsumeTotal) |
|
|
|
value, _ = consumptionMoney.Mul(floatSubsidyOpen).Div(consumeTotal).Add(baseSubsidyMoney).Float64() |
|
|
|
value, _ = consumptionMoney.Mul(floatSubsidyBili).Div(consumeTotal).Add(baseSubsidyMoney).Float64() |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
@@ -174,9 +177,12 @@ func calcNowEverydayExperienceIntegral(subsidyBase *model.SubsidyBase, hasExperi |
|
|
|
//2、通过公式计算 "((资金池的金额 * 浮动比例) / 体验补贴总数) + 基础补贴" |
|
|
|
experienceMoney, _ := decimal.NewFromString(subsidyBase.ExperienceTotalMoney) |
|
|
|
baseSubsidyMoney, _ := decimal.NewFromString(subsidyBase.BaseSubsidyMoney) |
|
|
|
floatSubsidyOpen := decimal.NewFromInt(int64(subsidyBase.FloatSubsidyOpen) / 10000) |
|
|
|
if subsidyBase.FloatSubsidyOpen == 0 { //没有浮动补贴情况 |
|
|
|
subsidyBase.FloatSubsidyBili = 0 |
|
|
|
} |
|
|
|
floatSubsidyBili := decimal.NewFromInt(int64(subsidyBase.FloatSubsidyBili) / 10000) |
|
|
|
consumeTotal := decimal.NewFromInt(hasExperienceTotal) |
|
|
|
value, _ = experienceMoney.Mul(floatSubsidyOpen).Div(consumeTotal).Add(baseSubsidyMoney).Float64() |
|
|
|
value, _ = experienceMoney.Mul(floatSubsidyBili).Div(consumeTotal).Add(baseSubsidyMoney).Float64() |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|