|
@@ -133,7 +133,7 @@ func DailySettlementBlockConsumeIntegral(engine *xorm.Engine, mid string, isTask |
|
|
} |
|
|
} |
|
|
var experienceTotalMap = make(map[int]decimal.Decimal) |
|
|
var experienceTotalMap = make(map[int]decimal.Decimal) |
|
|
var experienceTotalCountMap = make(map[int]int) |
|
|
var experienceTotalCountMap = make(map[int]int) |
|
|
if hasExperienceTotal > 0 { |
|
|
|
|
|
|
|
|
if hasExperienceTotal > 0 && consumeValue > 0 { |
|
|
experienceValue, err = calcNowEverydayExperienceIntegral(consumeValue) |
|
|
experienceValue, err = calcNowEverydayExperienceIntegral(consumeValue) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
_ = session.Rollback() |
|
|
_ = session.Rollback() |
|
@@ -203,7 +203,7 @@ func calcNowEverydayConsumeIntegral(subsidyBase *model.SubsidyBase, hasConsumeTo |
|
|
|
|
|
|
|
|
//计算当前体验积分价值(当前消费积分价值 * 10%) |
|
|
//计算当前体验积分价值(当前消费积分价值 * 10%) |
|
|
func calcNowEverydayExperienceIntegral(consumeValue float64) (value float64, err error) { |
|
|
func calcNowEverydayExperienceIntegral(consumeValue float64) (value float64, err error) { |
|
|
value = consumeValue * 0.1 |
|
|
|
|
|
|
|
|
value, _ = decimal.NewFromFloat(consumeValue * 0.1).RoundFloor(2).Float64() |
|
|
////2、通过公式计算 "((资金池的金额 * 浮动比例) / 体验补贴总数) + 基础补贴" |
|
|
////2、通过公式计算 "((资金池的金额 * 浮动比例) / 体验补贴总数) + 基础补贴" |
|
|
//experienceMoney, _ := decimal.NewFromString(subsidyBase.ExperienceTotalMoney) |
|
|
//experienceMoney, _ := decimal.NewFromString(subsidyBase.ExperienceTotalMoney) |
|
|
//baseSubsidyMoney, _ := decimal.NewFromString(subsidyBase.BaseSubsidyMoney) |
|
|
//baseSubsidyMoney, _ := decimal.NewFromString(subsidyBase.BaseSubsidyMoney) |
|
|