Topic:query()是什么意思,我在文档里面找不到解说。
// 从话题数据表里取出限定时间范围($pass_days)内,有发表过话题的用户 // 并且同时取出用户此段时间内发布话题的数量
$topic_users = Topic::query()->select(DB::raw(‘user_id, count(*) as topic_count’)) ->where(‘created_at’, ‘>=’, Carbon::now()->subDays($this->pass_days)) ->groupBy(‘user_id’) ->get();1.
推荐文章: