magento sql查询更新类别从非活动状态到活动状态

时间:2016-06-23 04:51:45

标签: magento

我目前有一个拥有几百个类别的magento网站,我遇到的问题是添加它们的人是否活跃到NO。我想将所有主要和子类别更新为is_active为YES(TRUE)。

我尝试过以下更新查询,将is_active更新为1,但即使我在索引管理中对所有内容编入索引,也不会在Magento中更新。

UPDATE catalog_category_flat_store_1 SET is_active = 1 WHERE is_active = 0

感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

catalog_category_flat_store_1表是出于性能原因而从EAV表中生成的表。它不是类别配置数据的真正来源。

您需要更新EAV中的数据。运行此查询以查找存储is_active的位置:

SELECT t1.attribute_id, t1.attribute_code, t1.backend_type
FROM eav_entity_type AS t0
INNER JOIN eav_attribute AS t1 ON (t0.entity_type_id = t1.entity_type_id)
WHERE (t0.entity_model = 'catalog/category')

在我的服务器上,它有attribute_id 42

然后,您需要查询catalog_category_entity并加入catalog_category_entity_int以获取要更新的行。

相关问题