mirror of
https://ids-dev.idsbuybuybuy.com/ids-ecommerce/ids-svc-product.git
synced 2026-11-29 16:57:41 +08:00
fix: update SQL queries to use FROM clause for catalog category joins
This commit is contained in:
parent
10034dbcee
commit
84db937041
@ -385,7 +385,7 @@ WHERE c.id = $1
|
||||
if _, err := tx.ExecContext(ctx, fmt.Sprintf(`
|
||||
UPDATE product.product_catalog_bindings pcb
|
||||
SET deleted_at = NOW(), updated_at = NOW()
|
||||
USING product.catalog_category pc
|
||||
FROM product.catalog_category pc
|
||||
WHERE pcb.category_id = pc.id
|
||||
AND pc.node_type = 2
|
||||
AND pc.store_id = $1
|
||||
|
||||
@ -1988,7 +1988,7 @@ FOR KEY SHARE
|
||||
if _, err := tx.ExecContext(ctx, `
|
||||
UPDATE product.product_catalog_bindings AS b
|
||||
SET deleted_at = NOW(), updated_at = NOW()
|
||||
USING product.catalog_category AS c
|
||||
FROM product.catalog_category AS c
|
||||
WHERE b.product_id = $1
|
||||
AND b.category_id = c.id
|
||||
AND c.node_type = 1
|
||||
@ -2086,7 +2086,7 @@ FOR KEY SHARE
|
||||
if _, err := tx.ExecContext(ctx, `
|
||||
UPDATE product.product_catalog_bindings AS b
|
||||
SET deleted_at = NOW(), updated_at = NOW()
|
||||
USING product.catalog_category AS c
|
||||
FROM product.catalog_category AS c
|
||||
WHERE b.product_id = $1
|
||||
AND b.category_id = c.id
|
||||
AND c.node_type = 2
|
||||
|
||||
Loading…
Reference in New Issue
Block a user