This commit is contained in:
seb
2026-10-04 21:22:05 +02:00
parent 0268583ae3
commit 4718cb5726
48 changed files with 758 additions and 758 deletions

View File

@@ -36,10 +36,10 @@ export const ARTICLE_DETAIL_COLUMNS = `
(
SELECT COUNT(*)
FROM article child
WHERE child.fatherarticle_id = a.id
WHERE child.parentarticle_id = a.id
) AS childCount,
a.fatherarticle_id AS fatherArticleId,
father.sku AS fatherSku
a.parentarticle_id AS parentArticleId,
parent.sku AS parentSku
`;
export const GET_DETAIL_BY_SKU = `
@@ -59,7 +59,7 @@ OUTER APPLY (
ORDER BY bp.sort ASC, bp.id ASC
) first_brand_pic
LEFT JOIN pic brand_pic ON brand_pic.id = first_brand_pic.pic_id
LEFT JOIN article father ON father.id = a.fatherarticle_id
LEFT JOIN article parent ON parent.id = a.parentarticle_id
WHERE a.sku = @sku AND (@companyId IS NULL OR a.company_id = @companyId)
`;
@@ -80,7 +80,7 @@ OUTER APPLY (
ORDER BY bp.sort ASC, bp.id ASC
) first_brand_pic
LEFT JOIN pic brand_pic ON brand_pic.id = first_brand_pic.pic_id
LEFT JOIN article father ON father.id = a.fatherarticle_id
LEFT JOIN article parent ON parent.id = a.parentarticle_id
WHERE a.id = @articleId
`;