fix(conversations): filter canal='turnero' out of individual chat message views
get_user_messages.php and get_recent_messages.php now exclude canal='turnero' so the main bot chat only shows bot messages even for users who also have turnero conversations. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
7eea2ff7ba
commit
3f964b424a
@@ -27,7 +27,7 @@ try {
|
|||||||
u.name
|
u.name
|
||||||
FROM conversations c
|
FROM conversations c
|
||||||
JOIN users u ON c.user_id = u.id
|
JOIN users u ON c.user_id = u.id
|
||||||
WHERE c.content IS NOT NULL AND c.content != ''
|
WHERE c.content IS NOT NULL AND c.content != '' AND (c.canal IS NULL OR c.canal = 'bot')
|
||||||
ORDER BY c.created_at DESC
|
ORDER BY c.created_at DESC
|
||||||
LIMIT 10"
|
LIMIT 10"
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ try {
|
|||||||
c.reaction_to_message_id as reaction_to_message_id
|
c.reaction_to_message_id as reaction_to_message_id
|
||||||
FROM conversations c
|
FROM conversations c
|
||||||
LEFT JOIN users u ON c.user_id = u.id
|
LEFT JOIN users u ON c.user_id = u.id
|
||||||
WHERE c.user_id = :user_id";
|
WHERE c.user_id = :user_id AND (c.canal IS NULL OR c.canal = 'bot')";
|
||||||
|
|
||||||
// Soporte para paginación estable: before (timestamp) y before_id (id del mensaje más antiguo del bloque)
|
// Soporte para paginación estable: before (timestamp) y before_id (id del mensaje más antiguo del bloque)
|
||||||
$beforeId = isset($_GET['before_id']) ? intval($_GET['before_id']) : null;
|
$beforeId = isset($_GET['before_id']) ? intval($_GET['before_id']) : null;
|
||||||
@@ -158,7 +158,7 @@ try {
|
|||||||
status,
|
status,
|
||||||
created_at
|
created_at
|
||||||
FROM conversations
|
FROM conversations
|
||||||
WHERE user_id = :user_id
|
WHERE user_id = :user_id AND (canal IS NULL OR canal = 'bot')
|
||||||
ORDER BY created_at ASC",
|
ORDER BY created_at ASC",
|
||||||
['user_id' => $userId]
|
['user_id' => $userId]
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user