diff --git a/model/gmodel/fs_address_logic.go b/model/gmodel/fs_address_logic.go index c346c507..08b747f2 100755 --- a/model/gmodel/fs_address_logic.go +++ b/model/gmodel/fs_address_logic.go @@ -24,19 +24,19 @@ func (a *FsAddressModel) CreateOne(ctx context.Context, address *FsAddress) (res err = a.db.WithContext(ctx).Transaction(func(tx *gorm.DB) error { // now := time.Now().UTC().Unix() result = &FsAddress{ - UserId: address.UserId, - Name: address.Name, - FirstName: address.FirstName, - LastName: address.LastName, - Mobile: address.Mobile, - Street: address.Street, - Suite: address.Suite, - City: address.City, - State: address.State, - Country: address.Country, - ZipCode: address.ZipCode, - Status: address.Status, - IsDefault: address.IsDefault, + UserId: address.UserId, + AddressName: address.AddressName, + FirstName: address.FirstName, + LastName: address.LastName, + Mobile: address.Mobile, + Street: address.Street, + Suite: address.Suite, + City: address.City, + State: address.State, + Country: address.Country, + ZipCode: address.ZipCode, + Status: address.Status, + IsDefault: address.IsDefault, } return tx.Create(result).Error @@ -57,7 +57,7 @@ func (a *FsAddressModel) UpdateAddAddress(ctx context.Context, address *FsAddres return err } } - return tx.Model(&FsAddress{}).Where("id = ? and user_id = ?", address.Id, address.UserId).Omit("id", "user_id").Updates(address).Error + return tx.Model(&FsAddress{}).Where("id = ? and user_id = ?", address.AddressId, address.UserId).Omit("id", "user_id").Updates(address).Error }) return err }