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