1$users = DB::table('users')
2 ->groupBy('account_id')
3 ->having('account_id', '>', 100)
4 ->get();
1->havingRaw('MAX(t2a_completed_date) BETWEEN ? AND ?', ['2021-05-22 17:00:00', '2021-05-22 18:00:00'])