Publish until

This commit is contained in:
2024-07-22 01:44:04 +08:00
parent 045744aa18
commit f5664715f8
4 changed files with 68 additions and 57 deletions

View File

@ -44,7 +44,9 @@ func FilterPostReply(tx *gorm.DB, replyTo ...uint) *gorm.DB {
}
func FilterPostWithPublishedAt(tx *gorm.DB, date time.Time) *gorm.DB {
return tx.Where("published_at <= ? OR published_at IS NULL", date)
return tx.
Where("published_at <= ? OR published_at IS NULL", date).
Where("published_until > ? OR published_until IS NULL", date)
}
func FilterPostWithAuthorDraft(tx *gorm.DB, uid uint) *gorm.DB {