Browse Source

DB Stat fix: Notes Pending Signature

Vijayakrishnan 3 years ago
parent
commit
5a9198b2a0
1 changed files with 3 additions and 3 deletions
  1. 3 3
      app/Models/Pro.php

+ 3 - 3
app/Models/Pro.php

@@ -344,9 +344,9 @@ class Pro extends Model
     }
 
     function get_notes_pending_signature_count_as_mcp() {
-        $query = Client::whereNull('shadow_pro_id');
-        return $query->where('mcp_pro_id', $this->id)
-            ->where('has_mcp_done_onboarding_visit', '!=', 'YES')
+        return Note::where('hcp_pro_id', $this->id)
+            ->where('is_cancelled', '<>', true)
+            ->where('is_signed_by_hcp', '<>', true)
             ->count();
     }