openvk/Web/Models/sql/read-messages.tsql
2021-01-27 18:05:29 +00:00

20 lines
333 B
Text

UPDATE
`messages`
SET
`unread` = 0
WHERE
(`id` > ?)
AND (
(
(`sender_type` = ?)
AND (`recipient_type` = ?)
AND (`sender_id` = ?)
AND (`recipient_id` = ?)
)
OR (
(`sender_type` = ?)
AND (`recipient_type` = ?)
AND (`sender_id` = ?)
AND (`recipient_id` = ?)
)
)