【发布时间】:2016-11-11 07:35:51
【问题描述】:
如何转换 Mysql 查询:
SELECT * , (
SELECT COUNT( * )
FROM articles
WHERE `user_id` =1
) AS total_count
FROM articles
WHERE `user_id` =1
GROUP BY user_id
进入 cakephp 子查询?
我试过了,
$articlescount = $this->Articles->find('all')->where(['user_id' => 1])->count();
print_r($articlescount);
这只会返回我的数量。
【问题讨论】:
标签: sql cakephp-3.0