Browse Source

fixed sticky note info

= 3 years ago
parent
commit
6fbcadcc1e
2 changed files with 8 additions and 1 deletions
  1. 7 0
      app/Models/Client.php
  2. 1 1
      resources/views/layouts/patient-header.blade.php

+ 7 - 0
app/Models/Client.php

@@ -108,6 +108,13 @@ class Client extends Model
         return $this->hasOne(Pro::class, 'id', 'default_na_pro_id');
         return $this->hasOne(Pro::class, 'id', 'default_na_pro_id');
     }
     }
 
 
+    public function stickyNoteUpdatedBySession()
+    {
+        return $this->hasOne(AppSession::class, 'id', 'sticky_note_updated_by_session_id');
+    }
+
+    
+
     public function creator()
     public function creator()
     {
     {
         return $this->hasOne(Pro::class, 'id', 'created_by_pro_id');
         return $this->hasOne(Pro::class, 'id', 'created_by_pro_id');

+ 1 - 1
resources/views/layouts/patient-header.blade.php

@@ -495,7 +495,7 @@ $addressParts .= implode(", ", $addressPart2);
         <div class="">
         <div class="">
           <span class="d-block text-secondary">{{$patient->sticky_note ?? '-' }}</span>
           <span class="d-block text-secondary">{{$patient->sticky_note ?? '-' }}</span>
           <div>
           <div>
-            <small class="text-muted">By: {{ $patientRecentStickyNote->createdBy->pro->displayName()  }} • At: {{ friendlier_date($patientRecentStickyNote->created_at) }}</small>
+            <small class="text-muted">By: {{ $patient->stickyNoteUpdatedBySession? $patient->stickyNoteUpdatedBySession->pro->displayName() : '-'  }} • At: {{ friendlier_date($patient->sticky_note_updated_at) }}</small>
           </div>
           </div>
         </div>
         </div>
         @endif
         @endif