我的桌子是这样的,我的收藏是 $testmodel=Mage::getModel(test/p1)->getCollection();
my database table is below.
id cat_id rate p_id
1 1 4 1
2 1 2 1
3 1 3 2
4 2 5 3
5 2 3 1
Run Code Online (Sandbox Code Playgroud)
我想使用集合在 magento 中输出这样的输出
cat_id rate count_category
1 9 3
2 8 2
Run Code Online (Sandbox Code Playgroud) magento ×1