瀏覽代碼

Query fix

Samson Mutunga 1 年之前
父節點
當前提交
3c5efdc9b7
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      resources/views/app/patient/segment-templates/omega_vitals/edit.blade.php

+ 1 - 2
resources/views/app/patient/segment-templates/omega_vitals/edit.blade.php

@@ -44,14 +44,13 @@ if(!$contentData) {
     }
 }
 
-$last4VisitsIDs = \App\Models\Note::where('client_id', $note->client_id)->where('id', '!=', $note->id)->pluck('id')->toArray();
+$last4VisitsIDs = \App\Models\Note::where('client_id', $note->client_id)->where('id', '!=', $note->id)->orderBy('id', 'desc')->limit(4)->pluck('id')->toArray();
 
 $previousVitals = [];
 $previousVitals = \App\Models\Point::where('parent_point_id', $point->id)
     ->where('category', 'REVIEW')
     ->whereIn('added_in_note_id', $last4VisitsIDs)
     ->orderBy('id', 'DESC')
-    ->limit(4)
     ->get();
 
 // convert to new format