Преглед на файлове

Updated RD appointments view

Samson Mutunga преди 1 година
родител
ревизия
293aa013bc
променени са 2 файла, в които са добавени 5 реда и са изтрити 6 реда
  1. 2 3
      app/Http/Controllers/RdController.php
  2. 3 3
      resources/views/app/rd/appointments.blade.php

+ 2 - 3
app/Http/Controllers/RdController.php

@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
 
 use App\Models\AccountInvite;
 use App\Models\Appointment;
+use App\Models\AppointmentView;
 use App\Models\Bill;
 use App\Models\Client;
 use App\Models\ClientBDTDevice;
@@ -157,9 +158,7 @@ class RdController extends Controller
     {
         $pro = $this->performer->pro;
         $filters = $request->all();
-        $appointments = Appointment::whereHas('client',function($qry)use($pro){
-            return $qry->where('rd_pro_id', $pro->id);
-        });
+        $appointments = AppointmentView::where('client_rd_pro_id', $pro->id);
         $this->filterMultiQuery($request, $appointments, 'raw_date', 'date_category', 'date_value_1', 'date_value_2');
         $this->filterSimpleQuery($request, $appointments, 'status', 'status');
         $appointments = $appointments->orderBy('end_time', 'DESC')->paginate(20);

+ 3 - 3
resources/views/app/rd/appointments.blade.php

@@ -30,11 +30,11 @@
                     @foreach($appointments as $appointment)
                     <tr>
                         <td>
-                            <a href="/patients/view/{{$appointment->client->uid}}/calendar/{{$appointment->uid}}">
+                            <a href="/patients/view/{{$appointment->client_uid}}/calendar/{{$appointment->uid}}">
                                 {{friendly_date($appointment->raw_date) . ' ' . friendly_time($appointment->raw_start_time)}}                            
                             </a>
                         </td>
-                        <td>{{ $appointment->client->displayName() }}</pre>
+                        <td>{{ $appointment->client_display_name }}</pre>
                         </td>
                         <td>{{ $appointment->title }}</td>
                         <td>{{ $appointment->description }}</td>
@@ -46,7 +46,7 @@
                             @endif
                         </td>
                         <td>
-                            @include('app.patient.partials.appointment-confirmation',['patient' => $appointment->client])
+                            @include('app.patient.partials.appointment-confirmation-light')
                         </td>
                     </tr>
                     @endforeach