cakephp 中连接查询多表 或group by

 $options = array(
                    ‘conditions‘ => $conditions,
                    ‘fields‘=>array(‘Category.*‘,‘COUNT(`Entity`.`id`) as `entity_count`‘),
                    ‘joins‘ => array(‘LEFT JOIN `entities` AS Entity ON `Entity`.`category_id` = `Category`.`id`‘),
                    ‘group‘ => ‘`Category`.`id`‘,
                    ‘contain‘ => array(‘Domain‘ => array(‘fields‘ => array(‘title‘)))
                );

                return $this->find(‘all‘, $options);

cakephp 中连接查询多表 或group by,布布扣,bubuko.com

cakephp 中连接查询多表 或group by

上一篇:[转]WCF:如何将net.tcp协议寄宿到IIS


下一篇:css学习笔记.1--以校园资讯平台为例