Explorar o código

Fix orari corsi

Luca Parisio hai 5 meses
pai
achega
2d182dd709

+ 3 - 1
app/Http/Livewire/Presence.php

@@ -74,12 +74,14 @@ class Presence extends Component
             $dow = date('w', strtotime($this->calendar->from));
             $dow = date('w', strtotime($this->calendar->from));
             $d = $days[$dow];
             $d = $days[$dow];
 
 
+            $h = date('H:i', strtotime($this->calendar->from));
+
             // Elenco corsi per tipologia in base al calendario
             // Elenco corsi per tipologia in base al calendario
             $courses = \App\Models\Course::where('name', $this->calendar->name)->where('date_from', '<=', $this->calendar->from)->where('date_to', '>=', $this->calendar->to)->pluck('id')->toArray();
             $courses = \App\Models\Course::where('name', $this->calendar->name)->where('date_from', '<=', $this->calendar->from)->where('date_to', '>=', $this->calendar->to)->pluck('id')->toArray();
 
 
 
 
             // Elenco utenti iscritti al corso "padre"
             // Elenco utenti iscritti al corso "padre"
-            $members_courses = \App\Models\MemberCourse::where('when', 'like', "%" . $d . "%")->whereIn('course_id', $courses)->pluck('member_id')->toArray();
+            $members_courses = \App\Models\MemberCourse::where('when', 'like', "%" . $d . "%")->where('when', 'like', '%"from":"' . $h . '"%')->whereIn('course_id', $courses)->pluck('member_id')->toArray();
 
 
             if ($this->filter != '')
             if ($this->filter != '')
             {
             {

+ 3 - 2
resources/views/livewire/presence.blade.php

@@ -60,7 +60,7 @@
 
 
         </div>    
         </div>    
         
         
-        <section id="resume-table" class="mt-5"  style="margin-bottom:20px">
+        <div id="resume-table" class="mt-5" >
             <div class="compare--chart_wrapper d-none"></div>
             <div class="compare--chart_wrapper d-none"></div>
             
             
             <div class="row">
             <div class="row">
@@ -69,6 +69,7 @@
                     <input type="text" class="form-control" placeholder="Cerca utente" wire:model="filter">
                     <input type="text" class="form-control" placeholder="Cerca utente" wire:model="filter">
                 </div>
                 </div>
             </div>
             </div>
+        </div>
         
         
             <table class="table tablesaw tableHead tablesaw-stack" id="tablesaw-350" width="100%">
             <table class="table tablesaw tableHead tablesaw-stack" id="tablesaw-350" width="100%">
                 <thead>
                 <thead>
@@ -127,7 +128,7 @@
                 </tbody>
                 </tbody>
             </table>
             </table>
 
 
-        </section>
+        
 
 
         @if($calendar->status == 0)
         @if($calendar->status == 0)
             <div class="row">
             <div class="row">