Pārlūkot izejas kodu

fixed next appointment none

= 3 gadi atpakaļ
vecāks
revīzija
30b8e05bfb

+ 6 - 0
app/Http/Controllers/AdminController.php

@@ -88,6 +88,12 @@ class AdminController extends Controller
             }
         }
 
+        if ($request->input('next_appointment_category')) {
+            if($request->input('next_appointment_category') == 'NONE'){
+                $patients = $patients->whereNull('next_mcp_appointment_id');
+            }
+        }
+
         $this->filterMultiQuery($request, $patients, 'age_in_years', 'age_category', 'age_value_1', 'age_value_2');
         $this->filterSimpleQuery($request, $patients, 'sex', 'sex');
         $this->filterMultiQuery($request, $patients, 'usual_bmi_max', 'bmi_category', 'bmi_value_1', 'bmi_value_2');

+ 2 - 1
resources/views/app/admin/patients_filters.blade.php

@@ -140,13 +140,14 @@
 			<label>Next Appt.:</label>
 			<select name="next_appointment_category" class="form-control input-sm" v-model="filters.next_appointment_category">
 				<option value="">All</option>
+				<option value="NONE">None</option>
 				<option value="EXACTLY">Exactly</option>
 				<option value="LESS_THAN">Less Than</option>
 				<option value="GREATER_THAN">Greater Than</option>
 				<option value="BETWEEN">Between</option>
 				<option value="NOT_BETWEEN">Not Between</option>
 			</select>
-			<div v-show="filters.next_appointment_category" class="mt-2">
+			<div v-show="filters.next_appointment_category && filters.next_appointment_category !== 'NONE'" class="mt-2">
 				<div>
 					<input  name="next_appointment_value_1" v-model="filters.next_appointment_value_1" type="number" class="form-control input-sm" :placeholder="(filters.next_appointment_category === 'BETWEEN' || filters.next_appointment_category === 'NOT_BETWEEN') ? 'From' : 'Next Appt.'" />
 				</div>