Re: Order by field containing aggregate function result (MIN)

2012-11-08 Thread Ivan Rimac
try like this $this->paginate = array( 'conditions' => array('Game.time !=' => NULL, 'Game.visible' => 1, 'Game.end_time !=' => NULL, 'Game.moves !=' => NULL), 'group' => array('Game.uid'), 'order' => array('Game.time' => 'DESC'), 'limit' => 3

Order by field containing aggregate function result (MIN)

2012-11-08 Thread Ivan Å valjek
Hi, I'm having trouble with sorting during pagination. I'm trying to list users with lowest solvetime, but order key in paginate method doesn't seem to like order field if it's a result of aggregate function like MIN(). This is my action: public function index() { $this->paginate =