本文整理汇总了PHP中app\Team::orderBy方法的典型用法代码示例。如果您正苦于以下问题:PHP Team::orderBy方法的具体用法?PHP Team::orderBy怎么用?PHP Team::orderBy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Team
的用法示例。
在下文中一共展示了Team::orderBy方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* Display the home page.
*
* @return Response
*/
public function index()
{
$teamResults = Team::orderBy('team_points', 'desc')->take(10)->get();
$matchDb = new Match();
$match = $matchDb->join('fantasy_club as home', 'fantasy_match.home_club_id', '=', 'home.club_id')->join('fantasy_club as guest', 'fantasy_match.guest_club_id', '=', 'guest.club_id')->select('home.club_name as home_name', 'guest.club_name as guest_name', 'match_date')->get();
return view('front.index')->with('teamResults', $teamResults)->with('j', $j = 1)->with('matches', $match);
}
示例2: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
// This gets all rows and all columns from the players table.
// If you want to change this. You can select specific columns by passing an array of the column names in all()
$teams = Team::orderBy('name', 'asc')->get();
return view('dashboard', compact('teams'));
}
示例3: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index(Request $request)
{
$this->generateSessionValueIfNotExists();
$data['teams'] = [];
$teams = Team::orderBy('name', 'asc')->get();
foreach ($teams as $team) {
$isFavourite = Rating::where('session', '=', $_SESSION["session"])->where('team_id', '=', $team->id)->get();
if (count($isFavourite) > 0) {
$team->isFavourite = true;
} else {
$team->isFavourite = false;
}
array_push($data['teams'], $team);
}
//$data['ratings'] = Rating::all();
$data['ratings'] = DB::select('select count(*) as votos, t.name as equipo, t.link as enlace, u.name as usuario
from ratings as r
join teams as t on r.team_id = t.id
join users as u on t.user_id = u.id
group by r.team_id
order by votos desc, t.name asc');
//dd($data);
$data['last_teams'] = Team::orderBy('id', 'desc')->limit(5)->get();
$data['users'] = User::all();
return view('welcome.welcome', $data);
}
示例4: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$users = User::orderBy('firstname')->paginate(12);
$teams = Team::orderBy('team_name')->get();
$roles = Role::orderBy('role_name')->get();
return view('cp.users.index', compact('users', 'teams', 'roles'));
}
示例5: create
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
// Just return the view function.
// If you want to add any data and pass it, just get the data and pass it as a second argument to view()
$teams = Team::orderBy('name', 'asc')->get();
return view('matches.create', compact('teams'));
}
示例6: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$teams = Team::orderBy('name', 'ASC')->get();
// To protect json vulnerability, prefix the response
// with a special string, Angular will automatically
// strip out it.
return ")]}',\n" . json_encode($teams);
}
示例7: index
public function index(Request $request)
{
//$userPlayers = UserPlayers::where('user_id', $request->user()->id)->get();
$userPlayers = $request->user()->userContractsPlayers;
$players = new Players();
$club = new Club();
$match = $request->user()->userPlayers;
$teamResults = Team::orderBy('team_points', 'desc')->take(10)->get();
return view('front.team_player_list')->with('userPlayers', $userPlayers)->with('players', $players)->with('club', $club)->with('i', $i = 1)->with('match', $match)->with('team', $request->user()->team)->with('teamResults', $teamResults)->with('j', $j = 1);
}
示例8: pagination
public function pagination($id)
{
$url_actual = "http://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
$url_actual = explode('?', $url_actual);
if ($id != 0) {
$pag = Team::where('challenge_id', $id)->orderBy('id', 'desc')->paginate(env('PAG'));
} else {
$pag = Team::orderBy('id', 'desc')->paginate(env('PAG'));
}
$pag->setPath($url_actual[0]);
return $pag;
}
示例9: playQuiz
public function playQuiz($quizid)
{
$quiz = Quiz::find($quizid);
$teams = Team::orderBy('name')->get();
$tables = array();
if ($quiz->teams) {
foreach (json_decode($quiz->teams) as $key => $value) {
$tables[$key] = $value;
}
}
$questionAnswered = Question::where('quiz', $quizid)->where('tableid_score', '>', 0)->first();
$questionsAnswered = count($questionAnswered) ? true : false;
return view('quiz')->with(['quiz' => $quiz, 'teams' => $teams, 'tables' => $tables, 'questionsAnswered' => $questionsAnswered]);
}
示例10: index
public function index()
{
$teamResults = Team::orderBy('team_points', 'desc')->paginate(20);
return view('front.results')->with('teamResults', $teamResults)->with('j', $j = 1);
}
示例11: ShowTeams
public function ShowTeams()
{
$data = Team::orderBy('id', 'desc')->paginate(10);
return view('admin/equipo', ['teams' => $data]);
}
示例12: index
/**
* Display a listing of the team.
*
* @return Response view with listing of teams
*/
public function index()
{
$teams = Team::orderBy('created_at', 'desc')->paginate(10);
return view('/teams/teams', ['teams' => $teams]);
}
示例13: groups
/**
* Groups List view
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function groups()
{
$teams = Team::orderBy('group', 'asc')->get();
return view('teams.groups', ['teams' => $teams]);
}
示例14: index
public function index()
{
return view('team.index', ['teams' => Team::orderBy('title')->get()]);
}
示例15: index
public function index($error = null)
{
$teamResults = Team::orderBy('team_points', 'desc')->take(10)->get();
return view('front.create_team', ['error' => $error])->with('teamResults', $teamResults)->with('j', $j = 1);
}