u
This commit is contained in:
@@ -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
|
||||
`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user