Merge branch 'develop' of gitee.com:fusenpack/fusenapi into develop

This commit is contained in:
laodaming 2023-09-26 11:11:58 +08:00
commit fc302ad1be

View File

@ -88,13 +88,13 @@ func (a *FsAddressModel) SettingUserDefaultAddress(ctx context.Context, userId i
now := time.Now().UTC() now := time.Now().UTC()
err = tx.Model(&FsAddress{}).Where(" `user_id` = ? and `status` = ? and `address_id` = ? ", userId, 1, addressId). err = tx.Model(&FsAddress{}).Where(" `user_id` = ? and `status` = ? and `address_id` = ? ", userId, 1, addressId).
UpdateColumn("ltime", now.Add(time.Hour*24*365*50)). UpdateColumn("ltime", now.AddDate(50, 0, 0)).
UpdateColumn("utime", now).Error UpdateColumn("utime", now).Error
if err != nil { if err != nil {
return err return err
} }
err = tx.Where(" `user_id` = ? and `status` = ? and `address_id` != ? and `ltime` > ? ", userId, 1, addressId, now.Add(time.Hour*24*365)). err = tx.Where(" `user_id` = ? and `status` = ? and `address_id` != ? and `ltime` > ? ", userId, 1, addressId, now.AddDate(1, 0, 0)).
UpdateColumn("ltime", now).Error UpdateColumn("ltime", now).Error
if err != nil { if err != nil {
logx.Error(err) logx.Error(err)