I have write down this query
pr($this->User->find('all',array('fields'=>array('DISTINCT User.last_name','User.first_name')))); die;
Array
(
[0] => Array
(
[User] => Array
(
[last_name] => singh
[first_name] => admin
)
)
[1] => Array
(
[User] => Array
(
[last_name] => singh
[first_name] => jaskaran
)
)
)
It is not working but when i remove first_name from fields then it is work
pr($this->User->find('all',array('fields'=>array('DISTINCT User.last_name')))); die;
result
Array
(
[0] => Array
(
[User] => Array
(
[last_name] => singh
)
)
)
but i need both field with distinct cakephp 2+