info address

This commit is contained in:
eson 2023-09-26 11:21:43 +08:00
parent 87c2d7bf96
commit 7eab65be87
2 changed files with 6 additions and 2 deletions

View File

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

View File

@ -175,6 +175,10 @@ func TestCaseJSON_EXTRACT(t *testing.T) {
conn := initalize.InitMysql("fsreaderwriter:XErSYmLELKMnf3Dh@tcp(fusen.cdmigcvz3rle.us-east-2.rds.amazonaws.com:3306)/fusen")
// err = conn.Exec(updatesql, 6).Error
var result []gmodel.FsAddress
conn.Model(&gmodel.FsAddress{}).Find(&result)
log.Println(conn.Model(&gmodel.FsChangeCode{}).Select("id").Where("id = 5").Take(nil).Error)
log.Println(err)
}