thinkphp中怎么用group和count查询三篇文章各自的评论数

2025-03-23 14:40:13
推荐回答(1个)
回答1:

$res = $class->where('in( 三篇文章id) ')->group('文章id的fied')->count();
tp好久没用不知道这样对不
原生:select count(*) from tableName where article_id in('xxx') group by article_id ;