Quellcode durchsuchen

Appts list order by fix

Vijayakrishnan vor 3 Jahren
Ursprung
Commit
4c7f7a15ad
2 geänderte Dateien mit 2 neuen und 3 gelöschten Zeilen
  1. 1 2
      app/Http/Controllers/PatientController.php
  2. 1 1
      app/Models/Client.php

+ 1 - 2
app/Http/Controllers/PatientController.php

@@ -542,12 +542,11 @@ class PatientController extends Controller
 
     public function appointments(Request $request, Client $patient, $forPro = 'all', $status = 'all') {
         $pros = $this->pros;
-        $appointments = $patient->appointmentsForProByStatus('all', 'ALL');
+        $appointments = $patient->appointmentsForProByStatus($forPro, strtoupper($status));
         $appointmentProIDs = $appointments->map(function($_item) {
             return $_item->pro_id;
         });
         $appointmentPros = Pro::whereIn('id', $appointmentProIDs)->get();
-        $appointments = $patient->appointmentsForProByStatus($forPro, strtoupper($status));
         return view('app.patient.appointments',
             compact('patient', 'pros', 'appointments', 'appointmentPros', 'forPro', 'status'));
     }

+ 1 - 1
app/Models/Client.php

@@ -338,7 +338,7 @@ class Client extends Model
         if($status !== 'ALL') {
             $appointments = $appointments->where('status', $status);
         }
-        $appointments = $appointments->orderBy('start_time', 'desc');
+        $appointments = $appointments->orderBy('raw_date', 'desc')->orderBy('raw_start_time', 'desc');
         return $appointments->get();
     }