From 0e7333b10485de29b1250ccba93edc64e802d9b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B6=9B?= Date: Thu, 22 Sep 2022 14:40:23 +0800 Subject: [PATCH] =?UTF-8?q?fix(park):=E4=BF=AE=E6=AD=A3=E4=B8=A4=E5=A4=84?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E4=BF=9D=E5=AD=98=E5=86=85=E5=AE=B9=E7=9A=84?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/end_user.go | 2 +- service/park.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/service/end_user.go b/service/end_user.go index 3c2c82a..5a15db1 100644 --- a/service/end_user.go +++ b/service/end_user.go @@ -454,7 +454,7 @@ func (es _EndUserService) StatEndUserRecordInPeriod(requestUser, requestPark, st elem.IsPublicMeter = archive.IsPublicMeter elem.Kind = archive.ParkDetail.SubmeterType } - if !elem.OverallFee.Decimal.IsZero() { + if elem.OverallFee.Valid && !elem.OverallFee.Decimal.IsZero() { elem.AdjustProportion = decimal.NewNullDecimal( elem.AdjustFee.Decimal.Div(elem.OverallFee.Decimal).RoundBank(8), ) diff --git a/service/park.go b/service/park.go index af79765..ab58527 100644 --- a/service/park.go +++ b/service/park.go @@ -37,7 +37,7 @@ func (_ParkService) UpdateParkInfo(park *model.Park) error { res, err := global.DB.NewUpdate().Model(park). Where("id = ?", park.Id). Where("user_id = ?", park.UserId). - Column("name", "abbr", "region", "address", "contact", "phone", "capacity", "tenement_quantity", "category", "meter_04kv_type"). + Column("name", "abbr", "region", "area", "address", "contact", "phone", "capacity", "tenement_quantity", "category", "meter_04kv_type"). Exec(ctx) if err != nil { if rows, _ := res.RowsAffected(); rows == 0 {