SELECT appeals.id, appeals.text, appeals.answer, appeals.joins, appeals.supports, appeals.dislikes, receivers.code, receivers.name_ru
FROM appeals
LEFT JOIN receivers ON receivers.id = appeals.toId
LEFT JOIN joins ON joins.autorId = 1 AND joins.appealId = appeals.id
WHERE appeals.lang = "ru"