Пример #1
0
 public function indexGame($id)
 {
     $game = Game::where('id', '=', $id)->orWhere('slug', '=', $id)->first();
     $events = $game->gameEvent()->where('approved', '=', '1')->where('public_state', '=', '1')->where('finish_date', '>=', date("Y-m-d"))->orderBy('start_date')->get();
     if (Sentry::check() && Sentry::getUser()->timezone) {
         return View::make('event.index_game_tz', array('events' => $events));
     }
     return View::make('event.index_game', array('events' => $events));
 }
Пример #2
0
 public function getRanking()
 {
     $ranking = Game::where('points', '>', 0)->orderBy('points', 'desc')->with('user')->with('level');
     $ranking = $ranking->paginate(20);
     return View::make('game.ranking', compact('ranking'));
 }
Пример #3
0
 public static function getGameUrlSiteMap()
 {
     $now = Carbon\Carbon::now();
     $games = Game::where('status', ENABLED)->where('start_date', '<=', $now)->orderBy('start_date', 'desc')->get();
     return $games;
 }