🐛 Fix visibility query issue
This commit is contained in:
parent
0fd742ffd2
commit
2fe32d6c98
@ -19,8 +19,8 @@ func FilterPostWithUserContext(tx *gorm.DB, user *models.Account) *gorm.DB {
|
||||
}
|
||||
|
||||
tx = tx.Where("visibility != ?", models.PostVisibilityFriends) // TODO Blocked by dealer, need support get friend list
|
||||
tx = tx.Where("visibility = ? AND ? = ANY (visible_users::jsonb[])", models.PostVisibilitySelected, user.ID)
|
||||
tx = tx.Where("visibility = ? AND NOT ( ? = ANY (invisible_users::jsonb[]) )", models.PostVisibilitySelected, user.ID)
|
||||
tx = tx.Where("visibility = ? AND visible_users @> '[?]'", models.PostVisibilitySelected, user.ID)
|
||||
tx = tx.Where("visibility = ? AND NOT invisible_users @> '[?]'", models.PostVisibilitySelected, user.ID)
|
||||
tx = tx.Where("visibility != ?", models.PostVisibilityNone)
|
||||
|
||||
return tx
|
||||
|
Loading…
Reference in New Issue
Block a user