🐛 Fix clear status affected the statutes cleared before

This commit is contained in:
2024-06-26 20:43:10 +08:00
parent 9519497887
commit feabff16ec
2 changed files with 4 additions and 8 deletions

View File

@ -75,6 +75,7 @@ func EditStatus(user models.Account, status models.Status) (models.Status, error
func ClearStatus(user models.Account) error {
if err := database.C.
Where("account_id = ?", user.ID).
Where("clear_at < ?", time.Now()).
Updates(models.Status{ClearAt: lo.ToPtr(time.Now())}).Error; err != nil {
return err
}