SELECT t1.entity_id, t1.`level`, t2.`value`, group_concat(t4.sku separator ',') as skus
FROM catalog_category_entity AS t1
LEFT JOIN catalog_category_entity_varchar AS t2 ON t2.entity_id=t1.entity_id
LEFT JOIN catalog_category_product AS t3 ON t3.category_id=t1.entity_id
LEFT JOIN catalog_product_entity AS t4 ON t4.entity_id=t3.product_id
WHERE t1.`level`>=2 AND t2.attribute_id=41 AND t2.store_id=0
GROUP BY t1.entity_id
[Magento SQL] 查询分类名称,和该分类下关联的所有sku
最新推荐文章于 2022-09-12 10:43:25 发布