本文整理匯總了PHP中Game::where方法的典型用法代碼示例。如果您正苦於以下問題:PHP Game::where方法的具體用法?PHP Game::where怎麽用?PHP Game::where使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Game
的用法示例。
在下文中一共展示了Game::where方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: indexGame
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: getRanking
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: getGameUrlSiteMap
public static function getGameUrlSiteMap()
{
$now = Carbon\Carbon::now();
$games = Game::where('status', ENABLED)->where('start_date', '<=', $now)->orderBy('start_date', 'desc')->get();
return $games;
}