🗑️ Remove the useless FilterWithRealm method

This commit is contained in:
LittleSheep 2024-12-09 22:24:55 +08:00
parent 8d1db481de
commit 39889fe43d

View File

@ -98,14 +98,6 @@ func FilterPostWithType(tx *gorm.DB, t string) *gorm.DB {
return tx.Where("type = ?", t)
}
func FilterPostWithRealm(tx *gorm.DB, id uint) *gorm.DB {
if id > 0 {
return tx.Where("realm_id = ?", id)
} else {
return tx.Where("realm_id IS NULL")
}
}
func FilterPostReply(tx *gorm.DB, replyTo ...uint) *gorm.DB {
if len(replyTo) > 0 && replyTo[0] > 0 {
return tx.Where("reply_id = ?", replyTo[0])