Имеется 2 запроса:
1 - без него фильтр не работает
2 - без него количество не работает.
1
"SELECT
DISTINCT b.id,
b.url,
b.image,
b.last_modify,
b.visible,
b.position,
$lang_sql->fields
FROM __brands b
$lang_sql->join
$category_join
$product_join
WHERE
1
$category_id_filter
$features_filter
$visible_brand_filter
$product_id_filter
ORDER BY b.position
$sql_limit
"
2
"SELECT
COUNT(p.id) AS count,
b.id,
b.name,
b.url,
b.meta_title,
b.meta_keywords,
b.meta_description,
b.description,
b.image
FROM __brands AS b
LEFT JOIN __products AS p
ON p.brand_id = b.id
$category_id_filter
GROUP BY b.id, p.brand_id
ORDER BY b.name"
Помогите соединить