Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \App\Comment::select('comments.user_id', 'topics.id', 'topics.name')
- ->from(DB::raw("(select * from comments where removed = 0 order by id desc) as comments"))
- ->join('topics', 'comments.topic_id', 'topics.id')
- ->whereIn('topics.cat_id', $cats)
- ->where('topics.removed', false)
- ->groupBy('topics.id')
- ->limit(5)
- ->get();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement