|
@@ -222,6 +222,12 @@ class AdminController extends Controller
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ $fVal = $request->input('imei');
|
|
|
+ if($fVal) {
|
|
|
+ $patients = $patients->whereRaw("((SELECT count(cbd.id) FROM client_bdt_device cbd
|
|
|
+ WHERE cbd.client_id = client.id AND cbd.device_id IN (SELECT bd.id FROM bdt_device bd WHERE bd.imei LIKE '%$fVal%' AND bd.is_active IS TRUE)) > 0)");
|
|
|
+ }
|
|
|
+
|
|
|
if($request->input('number_of_measurements')){
|
|
|
$keyName = $request->input('number_of_measurements');
|
|
|
$measurementCountQuery = '(SELECT COUNT(*) FROM measurement WHERE measurement.client_id = client.id AND is_active IS TRUE AND is_cellular IS TRUE AND is_cellular_zero IS NOT TRUE)';
|