天天看點

[Magento SQL] 傳回産品SKU,Stutus(上下架狀态)和庫存

#我這裡catalog_product_entity_int表attribute_id=96表示産品的狀态(status)
#
select t1.sku,t2.value as status,t3.qty from  catalog_product_entity as t1
left join catalog_product_entity_int as t2 on t1.entity_id=t2.entity_id
left join cataloginventory_stock_item as t3 on t3.product_id=t1.entity_id
where t2.attribute_id=96