in Magento 1.9 Community, I have this query

created_at >= subdate(now(), INTERVAL 1 DAY) Group By product_id order By sum(qty_ordered) desc

How do I do this in Helper/Data.php? Currently this is my code

$products = Mage::getModel('myshop/daily') ->getCollection() ->addAttributeToFilter('parent_item_id', array('null' => true))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.