From 8970e8be907c9a6eb5bb785d4a72f6e2b9d64595 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Wed, 3 Jan 2024 08:52:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rule/consume_integral_settlement.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rule/consume_integral_settlement.go b/rule/consume_integral_settlement.go index 6234eb1..16130ad 100644 --- a/rule/consume_integral_settlement.go +++ b/rule/consume_integral_settlement.go @@ -133,7 +133,7 @@ func DailySettlementBlockConsumeIntegral(engine *xorm.Engine, mid string, isTask } var experienceTotalMap = make(map[int]decimal.Decimal) var experienceTotalCountMap = make(map[int]int) - if hasExperienceTotal > 0 { + if hasExperienceTotal > 0 && consumeValue > 0 { experienceValue, err = calcNowEverydayExperienceIntegral(consumeValue) if err != nil { _ = session.Rollback() @@ -203,7 +203,7 @@ func calcNowEverydayConsumeIntegral(subsidyBase *model.SubsidyBase, hasConsumeTo //计算当前体验积分价值(当前消费积分价值 * 10%) func calcNowEverydayExperienceIntegral(consumeValue float64) (value float64, err error) { - value = consumeValue * 0.1 + value, _ = decimal.NewFromFloat(consumeValue * 0.1).RoundFloor(2).Float64() ////2、通过公式计算 "((资金池的金额 * 浮动比例) / 体验补贴总数) + 基础补贴" //experienceMoney, _ := decimal.NewFromString(subsidyBase.ExperienceTotalMoney) //baseSubsidyMoney, _ := decimal.NewFromString(subsidyBase.BaseSubsidyMoney)