SELECT `cp_brands` . `id` AS `id` , `cp_brands` . `nome` AS `nome` , `cp_brands` . `nomeesp` AS `nomeesp` , `cp_brands` . `cor` AS `cor` , `cp_brands` . `slugesp` AS `slugesp` , `cp_brands` . `slugeng` AS `slugeng` , `cp_brands` . `slogan` AS `slogan` , `cp_brands` . `sloganesp` AS `sloganesp` , `cp_brands` . `icon` AS `icon` , `cp_brands` . `ativo` AS `ativo` FROM `cp_brands` WHERE ( `cp_brands` . `excluido` IS NULL OR `cp_brands` . `excluido` = ? ) AND `cp_brands` . `ativo` = ? AND `cp_brands` . `id` IN ( SELECT `brand_id` FROM `cp_products` WHERE `ativo` = ? AND ( `excluido` = ? OR NOT `excluido` IS NULL ) ) ORDER BY `cp_brands` . `ordem` 