Skip to content

Commit f1c60d5

Browse files
authored
VCST-680: fix Association query (#723)
1 parent 17cd413 commit f1c60d5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/VirtoCommerce.CatalogModule.Data.SqlServer/SqlServerCatalogRawDatabaseCommand.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,11 +299,11 @@ FROM Association a"
299299

300300
command.Append(@"), Category_CTE AS
301301
(
302-
SELECT AssociatedCategoryId Id, AssociatedCategoryId
302+
SELECT AssociatedCategoryId Id, AssociatedCategoryId, Id AssociationId
303303
FROM Association_CTE
304304
WHERE AssociatedCategoryId IS NOT NULL
305305
UNION ALL
306-
SELECT c.Id, cte.AssociatedCategoryId
306+
SELECT c.Id, cte.AssociatedCategoryId, cte.AssociationId
307307
FROM Category c
308308
INNER JOIN Category_CTE cte ON c.ParentCategoryId = cte.Id
309309
),
@@ -325,7 +325,7 @@ Item_CTE AS
325325
,a.OuterId
326326
FROM Category_CTE cat
327327
LEFT JOIN Item i ON cat.Id=i.CategoryId
328-
LEFT JOIN Association a ON cat.AssociatedCategoryId=a.AssociatedCategoryId
328+
LEFT JOIN Association a ON cat.AssociationId = a.Id
329329
WHERE i.ParentId IS NULL
330330
UNION
331331
SELECT * FROM Association_CTE

0 commit comments

Comments
 (0)