コード例 #1
0
 public function subscribing()
 {
     $activities = Activity::orderBy('name')->get();
     $id_activity = '1';
     $partSubscribed = ActivityParticipant::join('participants', 'activitiesparticipants.id_participant', '=', 'participants.id')->select('participants.name as pName', 'participants.cpf', 'participants.type', 'activitiesparticipants.role_participant')->where('activitiesparticipants.id_activity', '=', $id_activity)->orderBy('pName')->get();
     $partNotSubscribed = Participant::WhereNotIn('id', function ($query) use($id_activity) {
         $query->select('id_participant')->from('activitiesparticipants')->where('id_activity', '=', $id_activity);
     })->orderBy('name')->get();
     $speakers = ActivityParticipant::join('participants', 'activitiesparticipants.id_participant', '=', 'participants.id')->select('participants.name as pName', 'participants.cpf', 'participants.type', 'activitiesparticipants.role_participant')->where('activitiesparticipants.id_activity', '=', $id_activity)->where('activitiesparticipants.role_participant', '=', 'speaker')->orderBy('pName')->get();
     $judges = ActivityParticipant::join('participants', 'activitiesparticipants.id_participant', '=', 'participants.id')->select('participants.name as pName', 'participants.cpf', 'participants.type', 'activitiesparticipants.role_participant')->where('activitiesparticipants.id_activity', '=', $id_activity)->where('activitiesparticipants.role_participant', '=', 'judge')->orderBy('pName')->get();
     $responsability = "Palestrantes";
     return view('lista.atividade', compact('activities', 'partSubscribed', 'partNotSubscribed', 'speakers', 'judges', 'responsability'));
 }
コード例 #2
0
 public function subscribing()
 {
     $participants = Participant::orderBy('name')->get();
     $id_participant = '2';
     $lectures = ActivityParticipant::join('activities', 'activitiesparticipants.id_activity', '=', 'activities.id')->select('activities.name as aName', 'activities.*', 'activitiesparticipants.role_participant')->where('activitiesparticipants.id_participant', '=', $id_participant)->where('activities.type', '=', 'lecture')->orderBy('aName')->get();
     $mini_courses = ActivityParticipant::join('activities', 'activitiesparticipants.id_activity', '=', 'activities.id')->select('activities.name as aName', 'activities.*', 'activitiesparticipants.role_participant')->where('activitiesparticipants.id_participant', '=', $id_participant)->where('activities.type', '=', 'mini_course')->orderBy('aName')->get();
     $technical_visits = ActivityParticipant::join('activities', 'activitiesparticipants.id_activity', '=', 'activities.id')->select('activities.name as aName', 'activities.*', 'activitiesparticipants.role_participant')->where('activitiesparticipants.id_participant', '=', $id_participant)->where('activities.type', '=', 'technical_visit')->orderBy('aName')->get();
     return view('lista.participantes', compact('lectures', 'mini_courses', 'technical_visits'));
 }