Ver Fonte

added pro name on client dashboard

= há 3 anos atrás
pai
commit
afd82cb855
2 ficheiros alterados com 19 adições e 11 exclusões
  1. 17 11
      app/Models/Pro.php
  2. 2 0
      resources/views/app/dashboard-admin.blade.php

+ 17 - 11
app/Models/Pro.php

@@ -1370,19 +1370,25 @@ ORDER BY cm.created_at DESC
 
     }
 
+
+    //TODO: move to dashboard controller
     public function followupsScheduledForToday() {
         return DB::select(DB::raw("
-SELECT crfu.id AS crfu_id,
-       crfu.next_follow_up_reason,
-       crfu.next_follow_up_memo,
-       c.uid as client_uid,
-       (c.name_first || ' ' || c.name_last) as client_name,
-       crfu.status AS status
-FROM client_rep_follow_up crfu join client c on crfu.id = c.client_rep_follow_up_id
-WHERE crfu.client_rep_pro_id = :pro_id
-  AND crfu.next_follow_up_date = :date
-  ORDER BY crfu.created_at DESC;
-        "), ["pro_id" => $this->id, 'date' => date('Y-m-d')]);
+            SELECT crfu.id AS crfu_id,
+                crfu.next_follow_up_reason,
+                crfu.next_follow_up_memo,
+                pro.name_first as pro_first_name, 
+                pro.name_last AS pro_last_name,
+                c.uid as client_uid,
+                (c.name_first || ' ' || c.name_last) as client_name,
+                crfu.status AS status
+            FROM client_rep_follow_up crfu 
+            join client c on crfu.id = c.client_rep_follow_up_id
+            join pro pro on pro.id = crfu.client_rep_pro_id
+            -- WHERE crfu.client_rep_pro_id = :pro_id 
+            WHERE crfu.next_follow_up_date = :date
+            ORDER BY crfu.created_at DESC;
+        "), ['date' => date('Y-m-d')]);
     }
 
 }

+ 2 - 0
resources/views/app/dashboard-admin.blade.php

@@ -439,6 +439,7 @@
                                         <thead>
                                         <tr>
                                             <th>Client</th>
+                                            <th>Assigned To</th>
                                             <th>Reason</th>
                                             <th>Status</th>
                                         </tr>
@@ -447,6 +448,7 @@
                                         @foreach($fus as $fu)
                                             <tr>
                                                 <td><a href="/patients/view/{{$fu->client_uid}}">{{$fu->client_name}}</a></td>
+                                                <td>{{$fu->pro_first_name}} {{$fu->pro_last_name}}</td>
                                                 <td>{{$fu->next_follow_up_reason}}</td>
                                                 <td>{{$fu->status}}</td>
                                             </tr>