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