From 2e8bbf2b992198dd297157b4ef282015bdaf2c05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B6=9B?= Date: Tue, 6 Sep 2022 18:52:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(god):=E8=A1=A5=E5=85=85=E9=81=97=E6=BC=8F?= =?UTF-8?q?=E7=9A=84=E6=8A=84=E8=A1=A8=E8=AE=B0=E5=BD=95=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/god_mode.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/service/god_mode.go b/service/god_mode.go index 3de2d29..a73fe79 100644 --- a/service/god_mode.go +++ b/service/god_mode.go @@ -6,6 +6,7 @@ import ( "electricity_bill_calc/global" "electricity_bill_calc/model" "fmt" + "log" "time" "github.com/samber/lo" @@ -91,6 +92,7 @@ func (_GodModeService) resetEndUserRecords(tx *xorm.Session, reportId string) (b err := tx.Where(builder.Eq{"report_id": reportId}).Find(&records) if err != nil { tx.Rollback() + log.Printf("[debug] [god mode] err: %+v", err) return false, err } for _, u := range records { @@ -121,6 +123,7 @@ func (_GodModeService) resetEndUserRecords(tx *xorm.Session, reportId string) (b u.LossFeeDiluted.Valid = false u.MaintenanceFeeDiluted.Valid = false u.FinalDiluted.Valid = false + u.PublicConsumptionDiluted.Valid = false u.FinalCharge.Valid = false affected, err := tx. @@ -156,7 +159,7 @@ func (_GodModeService) resetEndUserRecords(tx *xorm.Session, reportId string) (b "final_diluted", "final_charge", ). - Update(&u) + Update(u) if err != nil { tx.Rollback() return false, err