From 94a3cf6d78e0ec14562384d146af04d4c82f66a2 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 27 Apr 2023 16:11:34 +0800 Subject: [PATCH] test --- rule/self_buy_global.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rule/self_buy_global.go b/rule/self_buy_global.go index 529a256..dcbe477 100644 --- a/rule/self_buy_global.go +++ b/rule/self_buy_global.go @@ -222,6 +222,7 @@ func Pool(eg *xorm.Engine, price string) error { userSumMap[v["uid"]] -= leave } } + var RealBonusValue float64 = 0 for k, v := range userSumMap { if v <= 0 { continue @@ -231,7 +232,10 @@ func Pool(eg *xorm.Engine, price string) error { session.Rollback() return errors.New("失败") } + RealBonusValue += v } + bonus.RealBonusValue = zhios_order_relate_utils.Float64ToStrByPrec(RealBonusValue, 2) + bonus.LossBonusValue = zhios_order_relate_utils.Float64ToStrByPrec(zhios_order_relate_utils.StrToFloat64(price)-RealBonusValue, 2) bonus.BonusUserNum = zhios_order_relate_utils.IntToStr(sum) bonus.BonusUserRecord = zhios_order_relate_utils.SerializeStr(userSumMap) bonus.BonusPeriod = bonus.Id