magento中使用分组group
对模型对应的表集合进行排序
对模型对应的表集合读取指定条数的数据记录
$collection->getSelect()->group('entity_id');
$collection->groupByAttribute('entity_id');对模型对应的表集合进行排序
$collection = Mage::getModel('module/model_name')->getCollection();
$collection->getSelect()->order('last_name ASC'); 对模型对应的表集合读取指定条数的数据记录
$collection = Mage::getModel('module/model_name')->getCollection();
$collection->getSelect()->limit($n);
本文介绍了Magento中如何使用分组(group)功能对数据集合进行处理,并展示了如何对模型对应的表集合进行排序和读取指定数量的数据记录。
6万+

被折叠的 条评论
为什么被折叠?



