天天看点

[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