🐛 Fix filter with realm

This commit is contained in:
LittleSheep 2025-02-22 13:02:38 +08:00
parent a15a0d1c11
commit be1beb713c

View File

@ -156,7 +156,7 @@ func FilterPostWithUserContext(tx *gorm.DB, user *authm.Account, withRealm bool)
}
if !withRealm {
if len(realmList) > 0 {
tx = tx.Where("realm_id IN ?", realmList)
tx = tx.Where("realm_id IN ? OR realm_id IS NULL", realmList)
} else {
tx = tx.Where("realm_id IS NULL")
}