فهرست منبع

updated cellular device matrix

logicpowerhouse 4 سال پیش
والد
کامیت
eee32651a7

+ 2 - 2
app/Http/Controllers/PracticeManagementController.php

@@ -385,9 +385,9 @@ class PracticeManagementController extends Controller
         }
         $clients = [];
         if($targetPro){
-            $clients = Client::where('mcp_pro_id', $targetPro->id)->orderBy('created_at', 'desc')->paginate();
+            $clients = Client::where('mcp_pro_id', $targetPro->id)->orderBy('created_at', 'desc')->paginate(100);
         }else{
-            $clients = Client::orderBy('created_at', 'desc')->paginate();
+            $clients = Client::orderBy('created_at', 'desc')->paginate(100);
         }
         return view('app.practice-management.cellular-device-manager', compact('clients', 'allPros', 'targetPro'));
     }

+ 13 - 3
app/Models/Client.php

@@ -256,8 +256,17 @@ class Client extends Model
     {
     }
 
-    public function isCellularBPSent()
-    {
+    public function firstCellularBPDevice()
+    {
+        $devices = $this->devices();
+        $x = null;
+        foreach($devices as $device){
+            if($device->device->category == 'BP'){
+                $x = $device;
+                continue;
+            }
+        }
+        return $x;
     }
 
     public function getFirstCellularBPMeasurementAt()
@@ -272,8 +281,9 @@ class Client extends Model
     {
     }
 
-    public function isCellularWeightSent()
+    public function firstCellularWeightDevice()
     {
+
     }
 
     public function getFirstCellularWeightMeasurementAt()

+ 2 - 2
resources/views/app/practice-management/cellular-device-manager.blade.php

@@ -72,12 +72,12 @@
                             <td>{{ $client->mcpDisplayName() }}</td>
                             <td>{{ $client->rmeDisplayName() }}</td>
 
-                            <td>{{ $client->isCellularBPSent() ? 'Yes' : 'No' }}</td>
+                            <td>{{ $client->firstCellularBPDevice() ? 'Yes' : 'No' }}</td>
                             <td>{{ $client->getFirstCellularBPMeasurementAt()  }}</td>
                             <td>{{ $client->getLatestCellularBPMeasurementAt() }}</td>
                             <td>{{ $client->getTotalCellularBPMeasurements() }}</td>
 
-                            <td>{{ $client->isCellularWeightSent() ? 'Yes' : 'No' }}</td>
+                            <td>{{ $client->firstCellularWeightDevice() ? 'Yes' : 'No' }}</td>
                             <td>{{ $client->getFirstCellularWeightMeasurementAt()  }}</td>
                             <td>{{ $client->getLatestCellularWeightMeasurementAt() }}</td>
                             <td>{{ $client->getTotalCellularWeightMeasurements() }}</td>