我能理解哪个表中的产品是否是图像。这需要mysql queryes
,而不是magento models
。
答案 0 :(得分:3)
在catalog_product_entity_media_gallery
表格中,您可以获得有关产品图片的信息
请查看图片
从数据库获取图像的简单mysql查询是
$connection = Mage::getSingleton('core/resource')->getConnection('core_read');
$sql= "Select value from catalog_product_entity_media_gallery WHERE entity_id=1";
$rows = $connection->fetchAll($sql);
entity_id
是propductId
如果您有任何疑问,请告诉我
答案 1 :(得分:0)
还有magento
<!--
<?php
$products123321 = Mage::getModel('catalog/product')
->getCollection()
->addAttributeToSelect('*')
->addAttributeToFilter('image', 'no_selection');
foreach($products123321 as $product123321)
{
echo $product123321->getSku() . " has no image \n<br />\n";
//var_dump($product->getData()); //uncomment to see all product attributes
//remove ->addAttributeToFilter('image', 'no_selection');
//from above to see all images and get an idea of
//the things you may query for
}
?>
-->