This commit is contained in:
seb
2026-07-31 17:50:06 +02:00
parent 7e1e96d3cd
commit c2e128cb55
6 changed files with 116 additions and 3 deletions

View File

@@ -13,6 +13,7 @@ OUTER APPLY (
ORDER BY ap.sort ASC, ap.id ASC
) first_pic
LEFT JOIN pic ON pic.id = first_pic.pic_id
LEFT JOIN article father ON father.id = a.fatherarticle_id
`;
export const ARTICLE_LIST_COLUMNS = `
@@ -43,13 +44,15 @@ export const ARTICLE_LIST_COLUMNS = `
FROM article child
WHERE child.fatherarticle_id = a.id
) AS childCount,
a.fatherarticle_id AS fatherArticleId,
father.sku AS fatherSku,
pic.thumbw AS thumbW,
pic.thumbh AS thumbH,
pic.thumbhash AS thumbHash
`;
export const GET_CATEGORY_ID_BY_SKU = `
SELECT TOP 1 ca.category_id AS categoryId
SELECT TOP 1 ca.category_id AS categoryId, a.id AS articleId
FROM article a
INNER JOIN categoryarticle ca ON ca.article_id = a.id
WHERE a.sku = @sku

View File

@@ -2,3 +2,9 @@ export const CREATE = `
INSERT INTO articletext (article_id, language_id, name, slug)
VALUES (@articleId, @languageId, @name, @slug)
`;
export const UPDATE_BY_ARTICLE_AND_LANGUAGE = `
UPDATE articletext
SET name = @name, slug = @slug
WHERE article_id = @articleId AND language_id = @languageId
`;