->
leftJoin('category', 's_product_streams', 'stream', 'category.stream_id = stream.id'
) ->
leftJoin('stream', 's_product_streams_attributes', 'productStreamAttribute', 'stream.id = productStreamAttribute.streamId'
) ->
where('category.id IN (:categories)'
) ->
andWhere('category.active = 1'
) ->
andWhere('category.shops IS NULL OR category.shops LIKE :shopId'
) ->
addGroupBy('category.id'
) ->
setParameter(':categories',
$ids, Connection::PARAM_INT_ARRAY
) ->
setParameter(':shopId', '%|' .
$context->
getShop()->
getId() . '|%'
);
$this->fieldHelper->
addCategoryTranslation($query,
$context);
$this->fieldHelper->
addMediaTranslation($query,
$context);
$this->fieldHelper->
addProductStreamTranslation($query,
$context);
$this->fieldHelper->
addCategoryMainDataTranslation($query,
$context);
return $query;
} public function getMapping(array
$ids): QueryBuilder
{ $query =
$this->connection->
createQueryBuilder();
$query->
select(['mapping.articleID', 'GROUP_CONCAT(DISTINCT mapping.categoryID)'
]);