小编Pau*_*aan的帖子

通过rand()查询magento limit + order

function getIdModelsSliderJuwels(){
 $collection = Mage::getModel("catalog/product")->getCollection();
 $collection->addAttributeToFilter("attribute_set_id", 27); 
     $collection->addAttributeToSelect('modellijnen'); 
   //  $collection->setRandomOrder();
   //  $collection->getSelect()->limit( 5 ); 
 return $collection; 
}
Run Code Online (Sandbox Code Playgroud)

嗨,您好,

我想知道如何为在Magento中运行的查询设置限制因为 $collection->getSelect()->limit( 5 );不起作用.

另外如何随意选择,$collection->setRandomOrder();也行不通.

TXS.

magento

4
推荐指数
1
解决办法
1万
查看次数

标签 统计

magento ×1