Loading app/Http/Controllers/DivesAPI.php +5 −1 Original line number Diff line number Diff line Loading @@ -9,7 +9,11 @@ class DivesAPI extends Controller { function getDivers($diveID): array { $participants = User::select('*')->join('CAR_REGISTRATION', 'CAR_REGISTRATION.US_ID', '=', 'CAR_USER.US_ID')->where('CAR_REGISTRATION.DS_CODE', $diveID); $participants = User::select('*') ->join('CAR_REGISTRATION', 'CAR_REGISTRATION.US_ID', '=', 'CAR_USER.US_ID') ->join('CAR_DIVING_SESSION', 'CAR_DIVING_SESSION.DS_CODE', '=', 'CAR_REGISTRATION.DS_CODE') ->join('CAR_DIVING_LOCATION', 'CAR_DIVING_LOCATION.DL_ID', '=', 'CAR_DIVING_SESSION.DL_ID') ->where('CAR_REGISTRATION.DS_CODE', $diveID); $participants = $participants->get()->toArray(); return $participants; } Loading app/Models/DivingSession.php +3 −5 Original line number Diff line number Diff line Loading @@ -20,15 +20,13 @@ class DivingSession extends Model use HasFactory; public function getParticipants(): array{ $registrations = DB::table('CAR_REGISTRATION')->where('DS_CODE', $this->DS_CODE)->first(); $registrations = DB::table('CAR_REGISTRATION')->where('DS_CODE', $this->DS_CODE)->get(); $participants = []; foreach($registrations as $registration){ if($registration->REG_ACTIVE === 1){ $participants[] = User::find($registration->US_ID)->join('CAR_REGISTRATION', 'CAR_REGISTRATION.US_ID', '=', 'CAR_USER.US_ID')->where('CAR_REGISTRATION.DS_CODE', $this->DS_CODE)->first(); } $participants = User::find($registration->US_ID)->join('CAR_REGISTRATION', 'CAR_REGISTRATION.US_ID', '=', 'CAR_USER.US_ID')->where('CAR_REGISTRATION.DS_CODE', $this->DS_CODE); $participants = $participants->get()->toArray(); } return $participants; Loading resources/views/dive_infos_palanque.blade.php +0 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ <ul class="ps-5 mt-2 space-y-1 list-disc list-inside"> <li>Directeur de plongée : {{ $director->US_FIRST_NAME . " " . strtoupper($director->US_NAME) }}</li> <li>Sécurité de surface : {{ $security->US_FIRST_NAME . " " . strtoupper($security->US_NAME) }}</li> <li>Créateur de la plongée : {{ $creator->US_FIRST_NAME . " " . strtoupper($creator->US_NAME) }}</li> </ul> </li> <li>Nombre de plongeurs : {{ $dive->DS_DIVERS_COUNT }}</li> Loading Loading
app/Http/Controllers/DivesAPI.php +5 −1 Original line number Diff line number Diff line Loading @@ -9,7 +9,11 @@ class DivesAPI extends Controller { function getDivers($diveID): array { $participants = User::select('*')->join('CAR_REGISTRATION', 'CAR_REGISTRATION.US_ID', '=', 'CAR_USER.US_ID')->where('CAR_REGISTRATION.DS_CODE', $diveID); $participants = User::select('*') ->join('CAR_REGISTRATION', 'CAR_REGISTRATION.US_ID', '=', 'CAR_USER.US_ID') ->join('CAR_DIVING_SESSION', 'CAR_DIVING_SESSION.DS_CODE', '=', 'CAR_REGISTRATION.DS_CODE') ->join('CAR_DIVING_LOCATION', 'CAR_DIVING_LOCATION.DL_ID', '=', 'CAR_DIVING_SESSION.DL_ID') ->where('CAR_REGISTRATION.DS_CODE', $diveID); $participants = $participants->get()->toArray(); return $participants; } Loading
app/Models/DivingSession.php +3 −5 Original line number Diff line number Diff line Loading @@ -20,15 +20,13 @@ class DivingSession extends Model use HasFactory; public function getParticipants(): array{ $registrations = DB::table('CAR_REGISTRATION')->where('DS_CODE', $this->DS_CODE)->first(); $registrations = DB::table('CAR_REGISTRATION')->where('DS_CODE', $this->DS_CODE)->get(); $participants = []; foreach($registrations as $registration){ if($registration->REG_ACTIVE === 1){ $participants[] = User::find($registration->US_ID)->join('CAR_REGISTRATION', 'CAR_REGISTRATION.US_ID', '=', 'CAR_USER.US_ID')->where('CAR_REGISTRATION.DS_CODE', $this->DS_CODE)->first(); } $participants = User::find($registration->US_ID)->join('CAR_REGISTRATION', 'CAR_REGISTRATION.US_ID', '=', 'CAR_USER.US_ID')->where('CAR_REGISTRATION.DS_CODE', $this->DS_CODE); $participants = $participants->get()->toArray(); } return $participants; Loading
resources/views/dive_infos_palanque.blade.php +0 −1 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ <ul class="ps-5 mt-2 space-y-1 list-disc list-inside"> <li>Directeur de plongée : {{ $director->US_FIRST_NAME . " " . strtoupper($director->US_NAME) }}</li> <li>Sécurité de surface : {{ $security->US_FIRST_NAME . " " . strtoupper($security->US_NAME) }}</li> <li>Créateur de la plongée : {{ $creator->US_FIRST_NAME . " " . strtoupper($creator->US_NAME) }}</li> </ul> </li> <li>Nombre de plongeurs : {{ $dive->DS_DIVERS_COUNT }}</li> Loading