public function getSeoArticleQuery() { $attributesList =
Shopware()->
Container()->
get(CrudServiceInterface::
class)->
getList('s_articles_attributes'
);
$attributes =
[];
foreach ($attributesList as $attribute) { if ($attribute->
isIdentifier()) { continue;
} $attributes[] = 'at.' .
$attribute->
getColumnName();
} return '
SELECT a.*, d.ordernumber, d.suppliernumber, s.name AS supplier, a.datum AS date,
d.releasedate, a.changetime AS changed, ct.objectdata, ctf.objectdata AS objectdataFallback, ' .
implode(',',
$attributes) . "
FROM s_articles a
INNER JOIN s_articles_categories_ro ac
ON ac.articleID = a.id
AND ac.categoryID = ?
INNER JOIN s_categories c
ON c.id = ac.categoryID
AND c.active = 1
JOIN s_articles_details d
ON d.id = a.main_detail_id
LEFT JOIN s_articles_attributes at
ON at.articledetailsID=d.id
LEFT JOIN s_core_translations ct
ON ct.objectkey=a.id
AND ct.objectlanguage=?
AND ct.objecttype='article'
LEFT JOIN s_core_translations ctf
ON ctf.objectkey=a.id
AND ctf.objectlanguage=?
AND ctf.objecttype='article'
LEFT JOIN s_articles_supplier s
ON s.id=a.supplierID
WHERE a.active=1
AND a.changetime > ?
GROUP BY a.id
ORDER BY a.changetime, a.id
";