cakephp - find with order => field divide field (field/field) -


So the problem is fixed in this way. (About to find out about split areas) Virtual files are required. In the model:

  Class User, AppModel {public $ virtualFields = array ('ORDER_KD' = & gt; 'User.field1 / User.field2') is expanded;   

In the Controller:

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

thanks

You virtualFields , Because the command field / field is used as the DB column name.

Comments

Popular posts from this blog

python - how we can use ajax() in views.py in django? -

matlab - Using loops to get multiple values into a cell -

python - Sequence Pattern recognition with Pybrain -