🐛 Fix column naming issue in where statement

This commit is contained in:
2024-07-29 23:07:12 +08:00
parent f07364269a
commit 0fd742ffd2
2 changed files with 4 additions and 4 deletions

View File

@ -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_list::jsonb[])", models.PostVisibilitySelected, user.ID)
tx = tx.Where("visibility = ? AND NOT ( ? = ANY (invisible_users_list::jsonb[]) )", models.PostVisibilitySelected, user.ID)
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 != ?", models.PostVisibilityNone)
return tx