info address

This commit is contained in:
eson 2023-09-26 11:32:43 +08:00
parent 55a4526536
commit 47a1ecfc79

View File

@ -107,10 +107,8 @@ func (a *FsAddressModel) SettingUserDefaultAddress(ctx context.Context, userId i
}
func (a *FsAddressModel) DeleteOne(ctx context.Context, addressId int64, userId int64) (err error) {
address := &FsAddress{
AddressId: addressId,
UserId: &userId,
}
err = a.db.WithContext(ctx).Model(&FsAddress{}).Where("`address_id` = ? and `user_id` = ? and `status` = ? ", addressId, userId, 1).Delete(address).Error
err = a.db.WithContext(ctx).Model(&FsAddress{}).
Where("`address_id` = ? and `user_id` = ? and `status` = ? ", addressId, userId, 1).
UpdateColumn("status", 0).Error
return err
}