openvk/Web/Models/sql/read-messages.tsql

21 lines
333 B
Text
Raw Permalink Normal View History

2021-01-27 21:05:29 +03:00
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` = ?)
)
)