fix: page friend list by peer id

This commit is contained in:
richjohnrambo
2026-08-17 15:20:02 +08:00
parent d10c05b030
commit c60ed2e9ed
+3 -3
View File
@@ -6675,7 +6675,7 @@ func (a *adapter) TenantFriendshipList(id t.TenantID, uid t.Uid, queryText, init
if err != nil || parsed <= 0 {
return nil, "", t.ErrMalformed
}
where = append(where, "fs.id>?")
where = append(where, "fs.peer_id>?")
args = append(args, parsed)
}
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
JOIN im_users AS u ON u.id=fs.peer_id
WHERE `+strings.Join(where, " AND ")+`
ORDER BY fs.id ASC LIMIT ?`, args...)
ORDER BY fs.peer_id ASC LIMIT ?`, args...)
if err != nil {
return nil, "", err
}
@@ -6721,7 +6721,7 @@ func (a *adapter) TenantFriendshipList(id t.TenantID, uid t.Uid, queryText, init
return nil, "", err
}
if len(items) == limit {
nextCursor = strconv.FormatInt(row.ID, 10)
nextCursor = strconv.FormatInt(row.PeerID, 10)
continue
}
peerID := store.EncodeUid(row.PeerID)