You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') GROUP BY m.id ORDER BY m.name' at line 6
SELECT m.* FROM site_manufacturer m LEFT JOIN site_products p ON p.manufacturer_1c_id = m.id_1c LEFT JOIN category_bind cb ON cb.category_1c_name = p.category_1c_name LEFT JOIN site_sub_category sc ON sc.id = cb.sub_category_id WHERE 1 AND (sc.id =) GROUP BY m.id ORDER BY m.name