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

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -