1
我需要主頁Magento的 - 顯示隨機告別賽
$collection = Mage::getModel('turnkeye_testimonial/testimonial')->getCollection();
foreach($collection as $testimonial)
{
/My Div
}
我怎麼能做到這一點上隨機顯示告別賽?
我需要主頁Magento的 - 顯示隨機告別賽
$collection = Mage::getModel('turnkeye_testimonial/testimonial')->getCollection();
foreach($collection as $testimonial)
{
/My Div
}
我怎麼能做到這一點上隨機顯示告別賽?
$collection=Mage::getModel('turnkeye_testimonial/testimonial')->getCollection();
$collection->getSelect()->order('rand()');
$collection->setPage(1, $numProducts);
foreach($collection as $testimonial)
{
/My Div
}
不工作https://www.notableaccessories.com/index.php/ check $ collection-> getSelect() - > limit(1) - > order('rand()'); –
我現在編輯檢查 –
不工作$ collection-> getSelect() - > order('rand()'); $ collection-> setPage(1,1);我嘗試了價值或$ numProducts以及 –