From de53ac55419e79841eed4ddeb1537c826dae55cb Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Thu, 12 Dec 2024 15:49:23 +0800 Subject: [PATCH] update --- app/hdl/hdl_points_center.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/app/hdl/hdl_points_center.go b/app/hdl/hdl_points_center.go index d59a56f..acb67cc 100644 --- a/app/hdl/hdl_points_center.go +++ b/app/hdl/hdl_points_center.go @@ -581,7 +581,12 @@ func GetContributionValue(c *gin.Context) { } var contributionValue string if virtualAmount != nil { - contributionValue = virtualAmount.Amount + contributionValueDecimal, err := decimal.NewFromString(virtualAmount.Amount) + if err != nil { + e.OutErr(c, e.ERR_UNMARSHAL, err.Error()) + return + } + contributionValue = contributionValueDecimal.StringFixed(0) } coinDb := implement.NewVirtualCoinDb(db.Db) @@ -650,7 +655,12 @@ func GetContributionValueFlow(c *gin.Context) { list := make([]md.ContributionValueFlowNode, len(flows)) for i, flow := range flows { list[i].Title = flow.Title - list[i].Amount = flow.Amount + amountDecimal, err1 := decimal.NewFromString(flow.Amount) + if err1 != nil { + e.OutErr(c, e.ERR_UNMARSHAL, err1.Error()) + return + } + list[i].Amount = amountDecimal.StringFixed(0) list[i].Direction = utils.IntToStr(flow.Direction) list[i].CreateAt = flow.CreateAt }