|
@@ -128,8 +128,8 @@ func DailySettlementBlockConsumeIntegral(engine *xorm.Engine, mid string, isTask |
|
|
//3、修改 subsidy_base 中 consumption_money、experience_money |
|
|
//3、修改 subsidy_base 中 consumption_money、experience_money |
|
|
consumeTotal, _ := consumeValueTotal.Float64() |
|
|
consumeTotal, _ := consumeValueTotal.Float64() |
|
|
experienceTotal, _ := experienceValueTotal.Float64() |
|
|
experienceTotal, _ := experienceValueTotal.Float64() |
|
|
subsidyBase.ConsumptionMoney = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(subsidyBase.ConsumptionMoney) - consumeTotal) |
|
|
|
|
|
subsidyBase.ExperienceMoney = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(subsidyBase.ExperienceMoney) - experienceTotal) |
|
|
|
|
|
|
|
|
subsidyBase.ConsumptionTotalMoney = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(subsidyBase.ConsumptionTotalMoney) - consumeTotal) |
|
|
|
|
|
subsidyBase.ExperienceTotalMoney = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(subsidyBase.ExperienceTotalMoney) - experienceTotal) |
|
|
updateAffected, err := db.SubsidyBaseUpdate(session, subsidyBase.Id, subsidyBase, "consumption_money", "experience_money") |
|
|
updateAffected, err := db.SubsidyBaseUpdate(session, subsidyBase.Id, subsidyBase, "consumption_money", "experience_money") |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
_ = session.Rollback() |
|
|
_ = session.Rollback() |
|
@@ -154,7 +154,7 @@ 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.ConsumptionMoney) |
|
|
|
|
|
|
|
|
consumptionMoney, _ := decimal.NewFromString(subsidyBase.ConsumptionTotalMoney) |
|
|
baseSubsidyMoney, _ := decimal.NewFromString(subsidyBase.BaseSubsidyMoney) |
|
|
baseSubsidyMoney, _ := decimal.NewFromString(subsidyBase.BaseSubsidyMoney) |
|
|
floatSubsidyOpen := decimal.NewFromInt(int64(subsidyBase.FloatSubsidyOpen) / 10000) |
|
|
floatSubsidyOpen := decimal.NewFromInt(int64(subsidyBase.FloatSubsidyOpen) / 10000) |
|
|
consumeTotal := decimal.NewFromInt(hasConsumeTotal) |
|
|
consumeTotal := decimal.NewFromInt(hasConsumeTotal) |
|
@@ -165,7 +165,7 @@ func calcNowEverydayConsumeIntegral(subsidyBase *model.SubsidyBase, hasConsumeTo |
|
|
//计算当前体验积分价值 |
|
|
//计算当前体验积分价值 |
|
|
func calcNowEverydayExperienceIntegral(subsidyBase *model.SubsidyBase, hasExperienceTotal int64) (value float64, err error) { |
|
|
func calcNowEverydayExperienceIntegral(subsidyBase *model.SubsidyBase, hasExperienceTotal int64) (value float64, err error) { |
|
|
//2、通过公式计算 "((资金池的金额 * 浮动比例) / 体验补贴总数) + 基础补贴" |
|
|
//2、通过公式计算 "((资金池的金额 * 浮动比例) / 体验补贴总数) + 基础补贴" |
|
|
experienceMoney, _ := decimal.NewFromString(subsidyBase.ExperienceMoney) |
|
|
|
|
|
|
|
|
experienceMoney, _ := decimal.NewFromString(subsidyBase.ExperienceTotalMoney) |
|
|
baseSubsidyMoney, _ := decimal.NewFromString(subsidyBase.BaseSubsidyMoney) |
|
|
baseSubsidyMoney, _ := decimal.NewFromString(subsidyBase.BaseSubsidyMoney) |
|
|
floatSubsidyOpen := decimal.NewFromInt(int64(subsidyBase.FloatSubsidyOpen) / 10000) |
|
|
floatSubsidyOpen := decimal.NewFromInt(int64(subsidyBase.FloatSubsidyOpen) / 10000) |
|
|
consumeTotal := decimal.NewFromInt(hasExperienceTotal) |
|
|
consumeTotal := decimal.NewFromInt(hasExperienceTotal) |
|
|