JOIN clauses are at the same hierarchy level as FROM clause, which is correctly not indented.
F.e. better formatting for
...
FROM
{shop} AS s
LEFT JOIN {shop_price} AS pr ON pr.good_id = s.id
AND pr.trash = '0'
AND pr.date_start <= 1469606657
AND (
pr.date_start = 0
OR pr.date_finish >= 1469606657
)
AND pr.currency_id = 0
AND pr.role_id = 0
AND (pr.person = '0')
INNER JOIN {shop_param_element} AS pe3 ON pe3.element_id = s.id
AND pe3.param_id = '%d'
AND pe3.trash = '0'
...
.. would be
...
FROM
{shop} AS s
LEFT JOIN {shop_price} AS pr ON pr.good_id = s.id
AND pr.trash = '0'
AND pr.date_start <= 1469606657
AND (
pr.date_start = 0
OR pr.date_finish >= 1469606657
)
AND pr.currency_id = 0
AND pr.role_id = 0
AND (pr.person = '0')
INNER JOIN {shop_param_element} AS pe3 ON pe3.element_id = s.id
AND pe3.param_id = '%d'
AND pe3.trash = '0'
...
JOIN clauses are at the same hierarchy level as FROM clause, which is correctly not indented.
F.e. better formatting for
.. would be