我怎么能转换MySQL查询:子查询在CakePHP 3.0
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);
其中仅返回我没有计数。