コード例 #1
0
 public function index($fecha_id)
 {
     $partidos = Partido::where('fec_id', $fecha_id)->with('equipoLocal', 'equipoVisitante', 'estadio')->paginate(3);
     $fecha = Fecha::findOrFail($fecha_id)->with('fase.torneo.equiposParticipantes', 'fase.tipoFase')->where('fec_id', $fecha_id)->first();
     // return view('partidos.index',compact('partidos'))->with('fecha', $fecha);
     return view('partidos.index', compact('partidos', 'fecha'));
 }
コード例 #2
0
 public function getAllCities($id)
 {
     return Partido::where('idProvincia', '=', $id)->orderBy('nombre_partido')->get();
 }
コード例 #3
0
 public function index($fecha_id)
 {
     $partidos = Partido::where('fec_id', $fecha_id)->with('equipoLocal', 'equipoVisitante', 'estadio')->get();
     return $partidos->toJson();
 }
コード例 #4
0
 public function suspensiones_fecha($fecha_id)
 {
     $result["result"] = "Error";
     if ($fecha_id == '') {
         $fecha_id = Input::get("fecha_id");
     }
     $partidos = Partido::where("fecha_id", $fecha_id)->get();
     //dd($partidos);
     $fecha_id = (int) $fecha_id;
     if ($fecha_id != null) {
         $suspension = Suspension::with('socio')->with('estado')->with('evento')->with('evento.partido.fecha.torneo.temporada')->with('evento.tipo_evento')->with('partido')->with('tipo')->whereHas('evento', function ($q) use($fecha_id) {
             $q->whereHas('partido', function ($subq) use($fecha_id) {
                 $subq->where("fecha_id", $fecha_id);
             });
         })->get();
         if ($suspension != null) {
             $result["result"] = "Ok";
             $result["response"] = $suspension;
         } else {
             $result["description"] = "No existe suspension con tal id";
         }
     }
     return $result;
 }