From ffbf31f34584e564f2104e34d539e40404564363 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Wed, 27 Mar 2024 09:10:35 +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 --- db/db_subsidy_with_month.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/db/db_subsidy_with_month.go b/db/db_subsidy_with_month.go index 683cb89..aef0b2f 100644 --- a/db/db_subsidy_with_month.go +++ b/db/db_subsidy_with_month.go @@ -32,7 +32,12 @@ func SubsidyWithMonthInsert(session *xorm.Session, SubsidyWithUserFlow *model.Su amountValue := decimal.NewFromFloat(zhios_order_relate_utils.StrToFloat64(SubsidyWithUserFlow.ExperienceAmount)) data.ExperienceAmount = userAmountValue.Add(amountValue).RoundFloor(8).String() } - _, err := session.Where("id=?", data.Id).Cols("consume_amount,experience_amount").Update(&data) + if zhios_order_relate_utils.StrToFloat64(SubsidyWithUserFlow.StoreAmount) > 0 { + userAmountValue := decimal.NewFromFloat(zhios_order_relate_utils.StrToFloat64(data.StoreAmount)) + amountValue := decimal.NewFromFloat(zhios_order_relate_utils.StrToFloat64(SubsidyWithUserFlow.StoreAmount)) + data.StoreAmount = userAmountValue.Add(amountValue).RoundFloor(8).String() + } + _, err := session.Where("id=?", data.Id).Cols("consume_amount,experience_amount,store_amount").Update(&data) if err != nil { return 0, err }