浏览代码

Patient search - support search using cell_number

Vijayakrishnan 4 年之前
父节点
当前提交
0c70e44f2b
共有 3 个文件被更改,包括 9 次插入4 次删除
  1. 2 1
      app/Http/Controllers/HomeController.php
  2. 2 2
      public/css/style.css
  3. 5 1
      resources/views/app/patient-suggest.blade.php

+ 2 - 1
app/Http/Controllers/HomeController.php

@@ -373,7 +373,8 @@ class HomeController extends Controller
         if (empty($term)) return '';
         $clientQuery= Client::where(function ($q) use ($term) {
             $q->where('name_first', 'ILIKE', '%' . $term . '%')
-                ->orWhere('name_last', 'ILIKE', '%' . $term . '%');
+                ->orWhere('name_last', 'ILIKE', '%' . $term . '%')
+                ->orWhere('cell_number', 'ILIKE', '%' . $term . '%');
         });
 
         if($pro->pro_type != 'ADMIN'){

+ 2 - 2
public/css/style.css

@@ -475,7 +475,6 @@ input.search_field, textarea.search_field {
 .suggestions-outer {
     top: calc(100% + 2px);
     background: #fff;
-    width: calc(100% - 1rem);
     border-radius: 3px;
     border: 1px solid #ccc;
     z-index: 9999;
@@ -483,12 +482,13 @@ input.search_field, textarea.search_field {
 .suggestions-outer {
     top: calc(100% + 2px);
     background: #fff;
-    width: calc(100% - 1rem);
     border-radius: 3px;
     border: 1px solid #ccc;
     z-index: 9999;
     max-height: 220px;
     overflow-y: auto;
+    min-width: calc(100% - 0.5rem);
+    right: 0.5rem;
 }
 .suggestions-outer .suggest-item, .suggestions-outer .no-suggest-items {
     padding: 0.25rem 0.5rem;

+ 5 - 1
resources/views/app/patient-suggest.blade.php

@@ -3,6 +3,10 @@
 @endif
 <?php $activeSet = false; ?>
 @foreach($clients as $client)
-    <a class="d-block suggest-item {{ $activeSet ? '' : 'active'  }}" href="" data-target-uid="{{$client->uid}}">{{$client->displayName()}}</a>
+    <a class="d-block suggest-item text-nowrap {{ $activeSet ? '' : 'active'  }}"
+       href="" data-target-uid="{{$client->uid}}">
+        {{$client->displayName()}}
+        {!! $client->cell_number ? '<span class="text-sm text-secondary ml-1">(' . $client->cell_number . ')</span>' : '' !!}
+    </a>
     <?php $activeSet = true; ?>
 @endforeach