Untitled
unknown
plain_text
3 years ago
395 B
8
Indexable
$leaderboard = DB::table('user_p_n_r_submissions')
->selectRaw('user_id, CAST(SUM(user_point) as SIGNED ) as total_point',)
->where('status', PNRStatusEnum::VALID)
->whereBetween(DB::raw('DATE(created_at)'), array($from, $to))
->groupBy('user_id')
->orderBy('total_point', 'DESC')
->limit(50)
->get();Editor is loading...