Update get_user_messages.php
This commit is contained in:
@@ -66,11 +66,13 @@ try {
|
||||
|
||||
$params = ['user_id' => $userId];
|
||||
if ($before) {
|
||||
$sql .= " AND (c.created_at < :before";
|
||||
$params['before'] = $before;
|
||||
$sql .= " AND (c.created_at < :before_lt";
|
||||
$params['before_lt'] = $before;
|
||||
if ($beforeId) {
|
||||
// Incluir mensajes con mismo timestamp pero id menor (paginación estable)
|
||||
$sql .= " OR (c.created_at = :before AND c.id < :before_id)";
|
||||
// Usamos placeholder distinto para evitar duplicar el mismo nombre en la query
|
||||
$sql .= " OR (c.created_at = :before_eq AND c.id < :before_id)";
|
||||
$params['before_eq'] = $before;
|
||||
$params['before_id'] = $beforeId;
|
||||
}
|
||||
$sql .= ")";
|
||||
|
||||
Reference in New Issue
Block a user