本文整理汇总了PHP中group::lists方法的典型用法代码示例。如果您正苦于以下问题:PHP group::lists方法的具体用法?PHP group::lists怎么用?PHP group::lists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类group
的用法示例。
在下文中一共展示了group::lists方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show
/**
* Display the specified resource.
*
* @param int $id
* @return Response
*/
public function show(Request $request)
{
$groups = group::lists('name', 'group_id');
$locations = location::orderBy('location_id')->lists('location', 'location_id');
//$locations = array_merge($locations, array('0', 'National'));
$group_id = $request->input('group_id');
$location_id = $request->input('location_id');
if (!isset($group_id)) {
$group_id = 1;
}
if (!isset($location_id)) {
$location_id = 0;
}
/*
$rankings = \DB::table('rankings')
->join('players', 'rankings.player_id', '=', 'players.player_id')
->join('groups', 'rankings.group_id', '=', 'groups.group_id')
->join('locations', 'rankings.location_id', '=', 'locations.location_id')
->where('ranking_date', '=', $latest_date)
->where('rankings.group_id', '=', $group_id)
->where('rankings.location_id', '=', $location_id)
->distinct()
->get();
*/
$ranking = new Ranking();
$rankings = $ranking->getlatestRankings($group_id, $location_id);
return view('pages/rankings', compact('rankings', 'groups', 'locations'));
}