当前位置: 首页>>代码示例>>PHP>>正文


PHP Team::orderBy方法代码示例

本文整理汇总了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);
 }
开发者ID:elvinas21,项目名称:BasketballFantasyLeague,代码行数:12,代码来源:HomeController.php

示例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'));
 }
开发者ID:rcabr497,项目名称:beerPongV2,代码行数:12,代码来源:DashboardController.php

示例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);
 }
开发者ID:gorkaeff,项目名称:escudosfutbol,代码行数:31,代码来源:WelcomeController.php

示例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'));
 }
开发者ID:NuLeaf,项目名称:nuleaf-website,代码行数:12,代码来源:UsersController.php

示例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'));
 }
开发者ID:rcabr497,项目名称:beerPongV2,代码行数:12,代码来源:MatchController.php

示例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);
 }
开发者ID:rexwang,项目名称:dota_playground,代码行数:13,代码来源:TeamsController.php

示例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);
 }
开发者ID:elvinas21,项目名称:BasketballFantasyLeague,代码行数:10,代码来源:TeamPlayerListController.php

示例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;
 }
开发者ID:etciberoamerica,项目名称:robotica,代码行数:12,代码来源:TeamController.php

示例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]);
 }
开发者ID:andremiguelaa,项目名称:quiz-cascata,代码行数:14,代码来源:SiteController.php

示例10: index

 public function index()
 {
     $teamResults = Team::orderBy('team_points', 'desc')->paginate(20);
     return view('front.results')->with('teamResults', $teamResults)->with('j', $j = 1);
 }
开发者ID:elvinas21,项目名称:BasketballFantasyLeague,代码行数:5,代码来源:ResultsController.php

示例11: ShowTeams

 public function ShowTeams()
 {
     $data = Team::orderBy('id', 'desc')->paginate(10);
     return view('admin/equipo', ['teams' => $data]);
 }
开发者ID:DanielAlxx,项目名称:MOJ,代码行数:5,代码来源:AdminController.php

示例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]);
 }
开发者ID:matyapav,项目名称:sh-league,代码行数:10,代码来源:TeamController.php

示例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]);
 }
开发者ID:yeniceirl,项目名称:lvl52a,代码行数:10,代码来源:TeamsController.php

示例14: index

 public function index()
 {
     return view('team.index', ['teams' => Team::orderBy('title')->get()]);
 }
开发者ID:cat5inthecradle,项目名称:speechteam,代码行数:4,代码来源:TeamController.php

示例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);
 }
开发者ID:elvinas21,项目名称:BasketballFantasyLeague,代码行数:5,代码来源:TeamController.php


注:本文中的app\Team::orderBy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。