diff --git a/model/gmodel/fs_address_logic.go b/model/gmodel/fs_address_logic.go index 22498d89..3408e052 100755 --- a/model/gmodel/fs_address_logic.go +++ b/model/gmodel/fs_address_logic.go @@ -100,12 +100,7 @@ func (a *FsAddressModel) SettingUserDefaultAddress(ctx context.Context, userId i return err } - err = tx.Model(&FsAddress{}).Where("`user_id` = ? and `status` = 1 and `address_id` != ? and ltime > ?", userId, addressId, now.AddDate(10, 0, 0)).Take(nil).Error - if err != nil { - logx.Error(err) - } - - err = tx.Where("`user_id` = ? and `status` = 1 and `address_id` != ? and `ltime` > ?", userId, addressId, now.AddDate(10, 0, 0)). + err = tx.Model(&FsAddress{}).Where("`user_id` = ? and `status` = 1 and `address_id` != ? and `ltime` > ?", userId, addressId, now.AddDate(10, 0, 0)). UpdateColumn("ltime", now).Error if err != nil { logx.Error(err)