Esempio n. 1
0
 public function show($playerID)
 {
     $player = Master::where('playerID', '=', $playerID)->first();
     $battingGrids = BattingController::player($playerID);
     $pitchingGrids = PitchingController::player($playerID);
     $fieldingGrids = FieldingController::player($playerID);
     return view('players.show')->with(['player' => $player, 'battingGrids' => $battingGrids, 'pitchingGrids' => $pitchingGrids, 'fieldingGrids' => $fieldingGrids]);
 }
Esempio n. 2
0
 public function show($teamID, $year)
 {
     $team = Team::leftJoin('league', 'lgID', '=', 'league.id')->leftJoin('division', 'divID', '=', 'division.id')->where('teamID', '=', $teamID)->where('yearID', '=', $year)->first();
     \Debugbar::info($team);
     $battingGrids = BattingController::team($teamID, $year);
     $pitchingGrids = PitchingController::team($teamID, $year);
     $fieldingGrids = FieldingController::team($teamID, $year);
     return view('teams.show')->with(['team' => $team, 'year' => $year, 'battingGrids' => $battingGrids, 'pitchingGrids' => $pitchingGrids, 'fieldingGrids' => $fieldingGrids]);
 }
Esempio n. 3
0
 public static function player($playerID)
 {
     $batters = Batting::leftJoin('master', 'batting.playerID', '=', 'master.playerID')->leftJoin('teams', function ($join) {
         $join->on('batting.teamID', '=', 'teams.teamID');
         $join->on('batting.yearID', '=', 'teams.yearID');
     })->select('master.nameLast', 'master.nameFirst', 'teams.name', 'teams.yearID', 'teams.teamID', 'batting.G', 'batting.AB', 'batting.R', 'batting.H', 'batting.HR', 'batting.RBI')->where('batting.playerID', '=', $playerID);
     $grids = BattingController::grids($batters, 'player');
     return $grids;
 }