From edb05c407d398ec2dce5d148bb1eab81e252d5c6 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Wed, 24 Jul 2024 09:50:51 +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 --- consume/zhios_order_total_second.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/consume/zhios_order_total_second.go b/consume/zhios_order_total_second.go index f9a58c5..e28c791 100644 --- a/consume/zhios_order_total_second.go +++ b/consume/zhios_order_total_second.go @@ -138,12 +138,12 @@ func handleZhiosOrderTotalSecond(msg []byte) error { if ordData.State == 4 && ordData.IsTotal == 1 { isupdate = 1 isTotal = 2 - userStatistics.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics.Amount)-v.Amount-utils.StrToFloat64(v.AdditionalSubsidy), 4) + userStatistics.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics.Amount)-v.Amount-utils.StrToFloat64(v.AdditionalSubsidy), 6) } if ordData.State != 4 && ordData.IsTotal == 0 { isupdate = 1 isTotal = 1 - userStatistics.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics.Amount)+v.Amount+utils.StrToFloat64(v.AdditionalSubsidy), 4) + userStatistics.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics.Amount)+v.Amount+utils.StrToFloat64(v.AdditionalSubsidy), 6) } update, err := sess.Where("id=?", userStatistics.Id).Cols("amount").Update(&userStatistics) if err != nil { @@ -177,11 +177,11 @@ func handleZhiosOrderTotalSecond(msg []byte) error { isupdate1 := 0 if ordData.State == 4 && ordData.IsTotal == 1 { isupdate1 = 1 - userStatistics1.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics1.Amount)-v.Amount-utils.StrToFloat64(v.AdditionalSubsidy), 4) + userStatistics1.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics1.Amount)-v.Amount-utils.StrToFloat64(v.AdditionalSubsidy), 6) } if ordData.State != 4 && ordData.IsTotal == 0 { isupdate1 = 1 - userStatistics1.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics1.Amount)+v.Amount+utils.StrToFloat64(v.AdditionalSubsidy), 4) + userStatistics1.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics1.Amount)+v.Amount+utils.StrToFloat64(v.AdditionalSubsidy), 6) } update1, err1 := sess.Where("id=?", userStatistics1.Id).Cols("amount").Update(&userStatistics1) if err1 != nil { @@ -212,11 +212,11 @@ func handleZhiosOrderTotalSecond(msg []byte) error { isupdate1 := 0 if ordData.State == 4 && ordData.IsTotal == 1 { isupdate1 = 1 - userStatistics1.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics1.Amount)-v.Amount-utils.StrToFloat64(v.AdditionalSubsidy), 4) + userStatistics1.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics1.Amount)-v.Amount-utils.StrToFloat64(v.AdditionalSubsidy), 6) } if ordData.State != 4 && ordData.IsTotal == 0 { isupdate1 = 1 - userStatistics1.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics1.Amount)+v.Amount+utils.StrToFloat64(v.AdditionalSubsidy), 4) + userStatistics1.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics1.Amount)+v.Amount+utils.StrToFloat64(v.AdditionalSubsidy), 6) } update1, err1 := sess.Where("id=?", userStatistics1.Id).Cols("amount").Update(&userStatistics1) if err1 != nil { @@ -260,15 +260,15 @@ func handleZhiosOrderTotalSecond(msg []byte) error { } if ordData.State == 4 && (ordData.IsTotal == 1 || ordData.IsTotal == 3) { isTotal = 2 - userStatistics.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics.Amount)-utils.StrToFloat64(v.AfterAmount), 4) + userStatistics.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics.Amount)-utils.StrToFloat64(v.AfterAmount), 6) } if ordData.State != 4 && (ordData.IsTotal == 0) { isTotal = 3 - userStatistics.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics.Amount)+utils.StrToFloat64(v.AfterAmount), 4) + userStatistics.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics.Amount)+utils.StrToFloat64(v.AfterAmount), 6) } if ordData.State != 4 && (ordData.IsTotal == 1) { isTotal = 3 - userStatistics.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics.Amount)-utils.StrToFloat64(v.Amount), 4) + userStatistics.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics.Amount)-utils.StrToFloat64(v.Amount), 6) } _, err := sess.Where("id=?", userStatistics.Id).Cols("amount").Update(&userStatistics) if err != nil { @@ -293,15 +293,15 @@ func handleZhiosOrderTotalSecond(msg []byte) error { } if ordData.State == 4 && (ordData.IsTotal == 1 || ordData.IsTotal == 3) { isTotal = 2 - userStatistics1.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics1.Amount)-utils.StrToFloat64(v.AfterAmount), 4) + userStatistics1.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics1.Amount)-utils.StrToFloat64(v.AfterAmount), 6) } if ordData.State != 4 && (ordData.IsTotal == 0) { isTotal = 3 - userStatistics1.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics1.Amount)+utils.StrToFloat64(v.AfterAmount), 4) + userStatistics1.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics1.Amount)+utils.StrToFloat64(v.AfterAmount), 6) } if ordData.State != 4 && (ordData.IsTotal == 1) { isTotal = 3 - userStatistics1.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics1.Amount)-utils.StrToFloat64(v.Amount), 4) + userStatistics1.Amount = utils.Float64ToStrByPrec(utils.StrToFloat64(userStatistics1.Amount)-utils.StrToFloat64(v.Amount), 6) } _, err = sess.Where("id=?", userStatistics1.Id).Cols("amount").Update(&userStatistics) if err != nil {