如何以 cakephp 格式编写以下查询?
SELECT COUNT( ip_address ) AS num_values
FROM property_viewers
GROUP BY property_viewers.ip_address
ORDER BY property_viewers.id DESC
$this->model->find("count",array("fields"=>"ip_address",'group'=>'property_viewers.ip_address','order'=>'property_viewers.id DESC'))
$options['fields'] = array("ip_address");
$options['group'] = array("property_viewers.ip_address");
$options['order'] = array('property_viewers.id DESC');
$this->model->find("count",$options);
通过使用它,您不必担心嵌套数组