fix(park):修正两处不能保存内容的错误。
This commit is contained in:
parent
de6e24dcd3
commit
0e7333b104
|
@ -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),
|
||||
)
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue
Block a user