1$users = User::select('users*', 'analytics.*', DB::raw('SUM(analytics.revenue) As revenue'))
2 ->leftJoin('analytics', 'analytics.user_id', '=', 'users.id')
3 ->where('analytics.date', Carbon::today()->toDateString())
4 ->get();
1$users = User::select('users*', 'analytics.*', DB::raw('SUM(analytics.revenue) As revenue'))
2 ->leftJoin('analytics', 'analytics.user_id', '=', 'users.id')
3 ->where('analytics.date', Carbon::today()->toDateString())
4 ->get();
5