Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. $gamesToday = Jackpot::where('status', 3)->where('created_at', '>=', Carbon::today())->count();
  2.  
  3. $jackpot = Jackpot::where('status', 3)->max('bank');
  4.  
  5. $jackpotToday = Jackpot::where('created_at', '>=', Carbon::today())->max('bank');
  6.  
  7. $userToday = count(\DB::table('jackpot')
  8. ->join('jackpot_bets', 'jackpot.id', '=', 'jackpot_bets.game_id')
  9. ->join('users', 'jackpot_bets.user_id', '=', 'users.vk_id')
  10. ->where('jackpot.created_at', '>=', Carbon::today())
  11. ->groupBy('users.name')
  12. ->select('users.name')->get());
  13.  
  14. $response = [
  15. 'gamesToday' => $gamesToday,
  16. 'jackpot' => number_format($jackpot, 0, '.', ' '),
  17. 'userToday' => $userToday,
  18. 'jackpotToday' => number_format($jackpotToday, 0, '.', ' ')
  19. ];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement