SELECTCASEWHENe.collection_idISNOTNULLTHEN'collection'ELSE'entry'ENDas_type,CASEWHENe.collection_idISNOTNULLTHENe.collection_idELSEe.idENDas_id,COUNT(e.id) ASentriesCount,e.idasactiveEntryId,e.view_order,DATE(e.published_at) aspublishDate,_rankFROM (SELECTe0_.idASid,e0_.collection_idAScollection_id,e0_.published_atASpublished_at,e0_.view_orderASview_order,e0_.published_atAS_rankFROMentrye0_LEFT JOINcollectionc1_ONe0_.collection_id=c1_.idAND (c1_.deleted_atISNULL) AND (c1_.deleted_atISNULL) LEFT JOINentry_authore3_ONe0_.id=e3_.entry_idLEFT JOINauthora2_ONa2_.id=e3_.author_idAND (a2_.deleted_atISNULL) AND (a2_.deleted_atISNULL) WHERE ((e0_.is_published=1ANDe0_.is_banned=0) AND (c1_.is_published=1ORc1_.is_publishedISNULL) AND (a2_.is_enabled=1ORa2_.is_enabledISNULL)) AND (e0_.is_draft=0) AND (e0_.locale='ar') AND (e0_.published_at<=CURRENT_TIMESTAMP) AND (e0_.deleted_atISNULL) AND (e0_.deleted_atISNULL) ORDER BY_rankDESC,e0_.idDESCLIMIT1500) eGROUP BY_type,_idORDER BY_rankDESCLIMIT20
SELECTCASEWHENe.collection_idISNOTNULLTHEN'collection'ELSE'entry'ENDas_type,CASEWHENe.collection_idISNOTNULLTHENe.collection_idELSEe.idENDas_id,COUNT(e.id) ASentriesCount,e.idasactiveEntryId,e.view_order,DATE(e.published_at) aspublishDate,_rankFROM
(
SELECTe0_.idASid,e0_.collection_idAScollection_id,e0_.published_atASpublished_at,e0_.view_orderASview_order,e0_.published_atAS_rankFROMentrye0_LEFT JOINcollectionc1_ONe0_.collection_id=c1_.idAND (c1_.deleted_atISNULL)
AND (c1_.deleted_atISNULL)
LEFT JOINentry_authore3_ONe0_.id=e3_.entry_idLEFT JOINauthora2_ONa2_.id=e3_.author_idAND (a2_.deleted_atISNULL)
AND (a2_.deleted_atISNULL)
WHERE
(
(
e0_.is_published=1ANDe0_.is_banned=0
)
AND (
c1_.is_published=1ORc1_.is_publishedISNULL
)
AND (
a2_.is_enabled=1ORa2_.is_enabledISNULL
)
)
AND (e0_.is_draft=0)
AND (e0_.locale='ar')
AND (
e0_.published_at<=CURRENT_TIMESTAMP
)
AND (e0_.deleted_atISNULL)
AND (e0_.deleted_atISNULL)
ORDER BY_rankDESC,e0_.idDESCLIMIT1500
) eGROUP BY_type,_idORDER BY_rankDESCLIMIT20
SELECTCASEWHENe.collection_idISNOTNULLTHEN'collection'ELSE'entry'ENDas_type,CASEWHENe.collection_idISNOTNULLTHENe.collection_idELSEe.idENDas_id,COUNT(e.id) ASentriesCount,e.idasactiveEntryId,e.view_order,DATE(e.published_at) aspublishDate,_rankFROM (SELECTe0_.idASid,e0_.collection_idAScollection_id,e0_.published_atASpublished_at,e0_.view_orderASview_order,e0_.published_atAS_rankFROMentrye0_LEFT JOINcollectionc1_ONe0_.collection_id=c1_.idAND (c1_.deleted_atISNULL) AND (c1_.deleted_atISNULL) LEFT JOINentry_authore3_ONe0_.id=e3_.entry_idLEFT JOINauthora2_ONa2_.id=e3_.author_idAND (a2_.deleted_atISNULL) AND (a2_.deleted_atISNULL) WHERE ((e0_.is_published=1ANDe0_.is_banned=0) AND (c1_.is_published=1ORc1_.is_publishedISNULL) AND (a2_.is_enabled=1ORa2_.is_enabledISNULL)) AND (e0_.is_draft=0) AND (e0_.locale='ar') AND (e0_.published_at<=CURRENT_TIMESTAMP) AND (e0_.deleted_atISNULL) AND (e0_.deleted_atISNULL) ORDER BY_rankDESC,e0_.idDESCLIMIT1500) eGROUP BY_type,_idORDER BY_rankDESCLIMIT20;