Hi there,
I have a small issue that kept me busy for a whole day now.
I want to sort on a psuedofield, so I use this code in the controller:
function index() {
$this->Contract->recursive = 0;
$this->paginate = array(
'fields' => array('*', 'COALESCE(price_month_action,
price_month_regular) AS price_month_least'),
'limit' => 500,
'order' => array('price_month_least' => 'asc'));
$this->set('contracts', $this->paginate());
}
This works, but the 'price_month_least' value is outside of the
Contract array + sorting doesn't work when I pass the sorting
arguments in the URL like so: /contracts/index/sort:price_month_least/
I tried to add the pseudofield in the beforeFind in the Model, but
that didn't solve the problem. Could anybody help me out?
Thank you.
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
To unsubscribe, reply using "remove me" as the subject.