如何知道产品的形象

时间:2014-03-26 16:46:43

标签: magento

我能理解哪个表中的产品是否是图像。这需要mysql queryes,而不是magento models

2 个答案:

答案 0 :(得分:3)

catalog_product_entity_media_gallery表格中,您可以获得有关产品图片的信息

请查看图片

Image

从数据库获取图像的简单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_idpropductId

的位置

如果您有任何疑问,请告诉我

答案 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
}       
?>
-->