🐛 Fix filter issue
This commit is contained in:
parent
ef55cbb32a
commit
7f5183f83b
@ -11,8 +11,7 @@ import (
|
|||||||
func ListFriend(anyside models.Account, status models.FriendshipStatus) ([]models.AccountFriendship, error) {
|
func ListFriend(anyside models.Account, status models.FriendshipStatus) ([]models.AccountFriendship, error) {
|
||||||
var relationships []models.AccountFriendship
|
var relationships []models.AccountFriendship
|
||||||
if err := database.C.
|
if err := database.C.
|
||||||
Where(&models.AccountFriendship{AccountID: anyside.ID, Status: status}).
|
Where("(account_id = ? OR related_id = ?) AND status = ?", anyside.ID, anyside.ID, status).
|
||||||
Or(&models.AccountFriendship{RelatedID: anyside.ID, Status: status}).
|
|
||||||
Preload("Account").
|
Preload("Account").
|
||||||
Preload("Related").
|
Preload("Related").
|
||||||
Find(&relationships).Error; err != nil {
|
Find(&relationships).Error; err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user