سؤال

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

هل كانت مفيدة؟

المحلول

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top