fix: page friend list by peer id
This commit is contained in:
@@ -6675,7 +6675,7 @@ func (a *adapter) TenantFriendshipList(id t.TenantID, uid t.Uid, queryText, init
|
|||||||
if err != nil || parsed <= 0 {
|
if err != nil || parsed <= 0 {
|
||||||
return nil, "", t.ErrMalformed
|
return nil, "", t.ErrMalformed
|
||||||
}
|
}
|
||||||
where = append(where, "fs.id>?")
|
where = append(where, "fs.peer_id>?")
|
||||||
args = append(args, parsed)
|
args = append(args, parsed)
|
||||||
}
|
}
|
||||||
if q := strings.TrimSpace(queryText); q != "" {
|
if q := strings.TrimSpace(queryText); q != "" {
|
||||||
@@ -6697,7 +6697,7 @@ func (a *adapter) TenantFriendshipList(id t.TenantID, uid t.Uid, queryText, init
|
|||||||
FROM im_friendships AS fs
|
FROM im_friendships AS fs
|
||||||
JOIN im_users AS u ON u.id=fs.peer_id
|
JOIN im_users AS u ON u.id=fs.peer_id
|
||||||
WHERE `+strings.Join(where, " AND ")+`
|
WHERE `+strings.Join(where, " AND ")+`
|
||||||
ORDER BY fs.id ASC LIMIT ?`, args...)
|
ORDER BY fs.peer_id ASC LIMIT ?`, args...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, "", err
|
return nil, "", err
|
||||||
}
|
}
|
||||||
@@ -6721,7 +6721,7 @@ func (a *adapter) TenantFriendshipList(id t.TenantID, uid t.Uid, queryText, init
|
|||||||
return nil, "", err
|
return nil, "", err
|
||||||
}
|
}
|
||||||
if len(items) == limit {
|
if len(items) == limit {
|
||||||
nextCursor = strconv.FormatInt(row.ID, 10)
|
nextCursor = strconv.FormatInt(row.PeerID, 10)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
peerID := store.EncodeUid(row.PeerID)
|
peerID := store.EncodeUid(row.PeerID)
|
||||||
|
|||||||
Reference in New Issue
Block a user