From cb037204bfc8302b19f94fde8263565905baf644 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Sat, 23 Mar 2024 16:09:01 +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/model/subsidy_base.go | 1 + rule/consume_integral_settlement.go | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/db/model/subsidy_base.go b/db/model/subsidy_base.go index 1054671..9d04a7a 100644 --- a/db/model/subsidy_base.go +++ b/db/model/subsidy_base.go @@ -13,6 +13,7 @@ type SubsidyBase struct { ExperienceIntegral string `json:"experience_integral" xorm:"default 0.00 comment('体验积分数量') DECIMAL(20,2)"` ExperienceMoney string `json:"experience_money" xorm:"default 0.00 comment('体验补贴') DECIMAL(20,2)"` ExperienceTotalMoney string `json:"experience_total_money" xorm:"default 0.00 comment('资金池 体验补贴(元)') DECIMAL(20,2)"` + StoreTotalMoney string `json:"store_total_money" xorm:"default 0.00 comment('资金池 体验补贴(元)') DECIMAL(20,2)"` ConsumptionDay int `json:"consumption_day" xorm:"default 0 comment('消费补贴兑换后第X天') INT(11)"` ExperienceDay int `json:"experience_day" xorm:"comment('体贴补贴兑换后第X天') VARCHAR(255)"` SettleTime string `json:"settle_time" xorm:"comment('每天 XX:xx') VARCHAR(255)"` diff --git a/rule/consume_integral_settlement.go b/rule/consume_integral_settlement.go index 2ce14a1..f5279c9 100644 --- a/rule/consume_integral_settlement.go +++ b/rule/consume_integral_settlement.go @@ -208,10 +208,12 @@ func DailySettlementBlockConsumeIntegral(engine *xorm.Engine, mid string, isTask //3、修改 subsidy_base 中 consumption_money、experience_money consumeTotal, _ := consumeValueTotal.Float64() experienceTotal, _ := experienceValueTotal.Float64() + storeTotal, _ := storeValueTotal.Float64() subsidyBase.ConsumptionTotalMoney = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(subsidyBase.ConsumptionTotalMoney) - consumeTotal) subsidyBase.ExperienceTotalMoney = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(subsidyBase.ExperienceTotalMoney) - experienceTotal) + subsidyBase.StoreTotalMoney = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(subsidyBase.StoreTotalMoney) - storeTotal) subsidyBase.SettlementDate = today - updateAffected, err := db.SubsidyBaseUpdate(session, subsidyBase.Id, subsidyBase, "consumption_total_money", "experience_total_money", "settlement_date") + updateAffected, err := db.SubsidyBaseUpdate(session, subsidyBase.Id, subsidyBase, "consumption_total_money", "store_total_money", "experience_total_money", "settlement_date") if err != nil { _ = session.Rollback() return