magento产品eav笔记【持续跟新...】

//magento把产品信息分在子表中,最顶上的表是catalog_product_entity,仅仅包含产品的信息(SKU)

//表eav_attribute,这张表在magento里为全部不 同的实体存储了全部的属性

//注意entity_type_id,每个实体都有entity_type_id。catalog_product_entity中的记录值都是10

//在eav_entity_type表中存着全部entity实体的id值

//eav_attribute_set表中存全部属性集的值

//magento在eav_attribute表中使用backend_type记录,能够找到产品属性的backend_type

//以下简单的查询 entity_id(product_id)为2的产品的name属性值

SELECT
	e.entity_id AS product_id,
	var.value AS product_name
FROM
	b2c_catalog_product_entity e,
	b2c_eav_attribute eav,
	b2c_catalog_product_entity_varchar var
WHERE
	e.entity_type_id = eav.entity_type_id
AND eav.attribute_code = 'name'
AND eav.attribute_id = var.attribute_id
AND var.entity_id = e.entity_id
AND e.entity_id = 2;

原文地址:https://www.cnblogs.com/lcchuguo/p/5268330.html