'mapping',
'groups.mapping_id = mapping.id'
);
$query->
leftJoin( '`groups`',
's_core_shop_pages',
'shops',
'groups.id = shops.group_id AND shops.shop_id = :shopId'
);
$this->fieldHelper->
addShopPageTranslation($query,
$context);
$query->
andWhere('groups.active = 1'
) ->
andWhere('page.active = 1'
) ->
andWhere("CONCAT('|', page.grouping, '|') LIKE CONCAT('%|', groups.key, '|%')"
) ->
andWhere('(mapping.id IS NULL OR shops.shop_id IS NOT NULL)'
) ->
andWhere('(mapping.id IS NULL OR mapping.active=1)'
) ->
andWhere('(page.shop_ids IS NULL OR page.shop_ids LIKE :staticShopId)'
);
$query ->
orderBy('parentID', 'ASC'
) ->
addOrderBy('mapping.key'
)