This commit is contained in:
seb
2026-09-27 16:19:45 +02:00
parent e7f92ebef8
commit cd57f21af8
25 changed files with 412 additions and 49 deletions

View File

@@ -24,6 +24,11 @@ LEFT JOIN pic ON pic.id = (
SELECT ap.pic_id FROM articlepic ap
WHERE ap.article_id = a.id ORDER BY ap.sort, ap.id LIMIT 1
)
LEFT JOIN brand b ON b.id = a.brand_id
LEFT JOIN pic brand_pic ON brand_pic.id = (
SELECT bp.pic_id FROM brandpic bp
WHERE bp.brand_id = b.id ORDER BY bp.sort, bp.id LIMIT 1
)
LEFT JOIN article father ON father.id = a.fatherarticle_id
`;
@@ -119,7 +124,9 @@ SELECT auth.*,
'unitamount', a.unitamount, 'weight', a.weight,
'unitSi', u.si, 'unitBasesi', u.basesi,
'unitBasesifactor', u.basesifactor, 'unitSymbol', ut.symbol,
'unitName', ut.name, 'brandName', b.name,
'unitName', ut.name,
'brandId', b.id, 'brandName', b.name,
'brandFullHash', bp.hash,
'brandThumbW', bp.thumbw, 'brandThumbH', bp.thumbh,
'brandThumbHash', bp.thumbhash,
'optionsCount', (SELECT COUNT(*) FROM optionslistarticle WHERE optionslist_id = a.optionslist_id),