Luca Parisio 1 год назад
Родитель
Сommit
b1548eba3b
2 измененных файлов с 26 добавлено и 4 удалено
  1. 17 1
      app/Http/Livewire/Record.php
  2. 9 3
      resources/views/livewire/records.blade.php

+ 17 - 1
app/Http/Livewire/Record.php

@@ -149,7 +149,23 @@ class Record extends Component
                     ->whereNotIn('member_id', $exclude_from_records);
                     if ($this->filterCausals != null && sizeof($this->filterCausals) > 0)
                     {
-                        $datas->whereIn('causal_id', $this->filterCausals);
+                        $causals = array();
+                        foreach($this->filterCausals as $z)
+                        {
+                            $causals[] = $z;
+                            $childs = \App\Models\Causal::where('parent_id', $z)->get();
+                            foreach($childs as $c)
+                            {
+                                $causals[] = $c->id;
+                                $childsX = \App\Models\Causal::where('parent_id', $c->id)->get();
+                                foreach($childsX as $cX)
+                                {
+                                    $causals[] = $cX->id;
+
+                                }
+                            }
+                        }
+                        $datas->whereIn('causal_id', $causals);
                     }
                     if ($this->filterMember != null && $this->filterMember > 0)
                     {

+ 9 - 3
resources/views/livewire/records.blade.php

@@ -48,9 +48,9 @@
                 <div class="col-md-2">
                 </div>
                 <div class="col-md-2">
-                    <div class="prima--nota_buttons ms-auto">
-                        <button class="btn--ui_outline light reset" wire:click="export()" style="margin-left:5px;"><i class="fa-solid fa-download"></i></button>
-                        <button class="btn--ui_outline light reset" style="margin-left:5px;" id="print"><i class="fa-solid fa-print"></i></button>
+                    <div class="prima--nota_buttons ms-auto " style="float:right; margin-top:30px;">
+                        <button class="btn--ui_outline light reset" wire:click="export()" style="margin-left:5px;color:#10172A"><i class="fa-solid fa-download"></i></button>
+                        <button class="btn--ui_outline light reset" style="margin-left:5px;color:#10172A;" id="print"><i class="fa-solid fa-print"></i></button>
                     </div>
                 </div>
             </div>
@@ -205,6 +205,12 @@
 @push('scripts')
     <link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
     <style>
+        table thead {
+        /* Important */
+            position: sticky;
+            z-index: 100;
+            top: 0;
+        }
         .select2-container--default .select2-selection--single{
             background-color: #E9F0F5;
             border: 0.0625rem solid #DFE5EB;