SELECT translationId FROM products where lang=:lang and (labelAction=1) AND translationId IN (SELECT affi.pid
FROM all_filters_filters_items affi
WHERE affi.fid IN (7613,7643,9593,11773)
GROUP BY affi.pid
HAVING SUM(CASE WHEN affi.fid IN (7613,7643) THEN 1 ELSE 0 END) > 0 AND SUM(CASE WHEN affi.fid IN (9593,11773) THEN 1 ELSE 0 END) > 0) and translationId in (select distinct pid from products_categories where cid in (-1,781,785,791,957,959)) and active=1Array
(
[0] => 244252
[1] => 326452
[2] => 342728
[3] => 88374
[4] => 88376
[5] => 88612
[6] => 186620
[7] => 243970
)