Commit bca949cb authored by LucBUTGH's avatar LucBUTGH
Browse files

Fix: number of dives of divers for a director

parent 4ffbd949
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -32,13 +32,13 @@ public function index(): View

    public function allIndex(): View
    {
        $usersDatas = DivingNumberModel::selectRaw('COUNT(*) as aggregate, car_user.US_NAME')
        $usersDatas = DivingNumberModel::selectRaw('COUNT(*) as aggregate, car_user.US_FIRST_NAME, car_user.US_NAME')
    ->join('car_registration', 'car_user.us_id', '=', 'car_registration.us_id')
    ->join('car_diving_group', function ($join) {
        $join->on('car_registration.ds_code', '=', 'car_diving_group.ds_code')
            ->on('car_registration.dg_number', '=', 'car_diving_group.dg_number');
    })
    ->groupBy('car_user.us_id', 'car_user.US_NAME')
    ->groupBy('car_user.us_id', 'car_user.US_NAME', 'car_user.US_FIRST_NAME')
    ->get();

        return view('alldiversactivities', ['datas' => $usersDatas]);
+4 −2
Original line number Diff line number Diff line
<x-layout>
    <x-page-title>Plongées restantes</x-page-title>
    <x-page-title>Plongées réalisées</x-page-title>
    <div class="shadow-md max-w-full rounded-lg overflow-hidden border-2">
        <table class="text-sm text-left text-gray-500 w-full">
            <thead class="text-xs text-gray-700 uppercase bg-gray-50">
            <tr>
                <th scope="col" class="px-6 py-3">Nombre de plongées réalisées</th>
                <th scope="col" class="px-6 py-3">Plongeur</th>
                <th scope="col" class="px-6 py-3">Prénom</th>
                <th scope="col" class="px-6 py-3">Nom</th>

            </tr>
            </thead>
@@ -13,6 +14,7 @@
            @foreach ($datas as $data)
                <tr class="odd:bg-white even:bg-gray-50 border-b">
                    <td class="px-6 py-4">{{ $data->aggregate }}</td>
                    <td class="px-6 py-4">{{ $data->US_FIRST_NAME }}</td>
                    <td class="px-6 py-4">{{ $data->US_NAME }}</td>
                </tr>
            @endforeach