fix(park):修正两处不能保存内容的错误。

This commit is contained in:
徐涛 2022-09-22 14:40:23 +08:00
parent de6e24dcd3
commit 0e7333b104
2 changed files with 2 additions and 2 deletions

View File

@ -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),
)

View File

@ -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 {