Question

So problem fixed like this. (About find with divide fields) Need use virtualFields. In model:

class User extends AppModel{
    public $virtualFields = array(
    'ORDER_KD' => 'User.field1 / User.field2'
);

In controller:

$this->User->find('all', array(
             ...//some conditions etc...
             'order'=> array(
                 "ORDER_KD" => 'desc'), //virtualField
             'limit' => 15                
         ));

Thanks kicaj

Was it helpful?

Solution

You can use virtualFields, because order field / field is used as db column name.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top