Merge branch 'develop' of gitee.com:fusenpack/fusenapi into develop
This commit is contained in:
commit
5be1edfa71
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user