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
Post a Comment