SELECT G.*, IF(LENGTH(G.descricao) > 224, CONCAT(LEFT(G.descricao, 220),' ...'), G.descricao) AS descricao, C.titulo AS NOME_CATEGORIA,C.image AS ICONE_CATEGORIA FROM mod_guia_comercial G JOIN dados_categorias C ON G.categoria = C.id WHERE G.status = 'on' AND G.site = '1' AND G.categoria = :categoria AND G.estado = :estado AND setor = 'class' ORDER BY G.id DESC