Explorar o código

ordinamento mensilità + cambio etichette

ferrari hai 3 semanas
pai
achega
1c82b1f14d

+ 1 - 1
app/Http/Livewire/Course.php

@@ -145,7 +145,7 @@ class Course extends Component
         // $this->course_types = \App\Models\CourseType::select('*')->where('enabled', true)->get();
         $this->course_durations = \App\Models\CourseDuration::select('*')->where('enabled', true)->get();
         $this->course_levels = \App\Models\CourseLevel::select('*')->where('enabled', true)->get();
-        $this->course_subscriptions = \App\Models\CourseSubscription::select('*')->where('enabled', true)->get();
+        $this->course_subscriptions = \App\Models\CourseSubscription::select('*')->where('enabled', true)->orderBy('name', 'asc')->get();
         $this->course_frequencies = \App\Models\CourseFrequency::select('*')->where('enabled', true)->get();
         $this->causals = \App\Models\Causal::select('*')->where('type', 'IN')->where('enabled', true)->get();
         $this->instructors = \App\Models\User::select('*')->where('level', 2)->get();

+ 3 - 3
app/Http/Livewire/Member.php

@@ -423,7 +423,7 @@ class Member extends Component
                 }
             }
 
-            $this->course_subscriptions = \App\Models\CourseSubscription::select('*')->whereIn('id', $course_subscription_ids)->where('enabled', true)->get();
+            $this->course_subscriptions = \App\Models\CourseSubscription::select('*')->whereIn('id', $course_subscription_ids)->where('enabled', true)->orderBy('name', 'asc')->get();
         } else {
             $this->course_price = 0;
             $this->course_subscription_price = 0;
@@ -820,7 +820,7 @@ class Member extends Component
                 }
             }
 
-            $this->course_subscriptions = \App\Models\CourseSubscription::select('*')->whereIn('id', $course_subscription_ids)->where('enabled', true)->get();
+            $this->course_subscriptions = \App\Models\CourseSubscription::select('*')->whereIn('id', $course_subscription_ids)->where('enabled', true)->orderBy('name', 'asc')->get();
         } else {
             $this->course_price = 0;
             $this->course_subscription_price = 0;
@@ -2168,7 +2168,7 @@ class Member extends Component
                     }
                 }
 
-                $this->course_subscriptions = \App\Models\CourseSubscription::select('*')->whereIn('id', $course_subscription_ids)->where('enabled', true)->get();
+                $this->course_subscriptions = \App\Models\CourseSubscription::select('*')->whereIn('id', $course_subscription_ids)->where('enabled', true)->orderBy('name', 'asc')->get();
 
                 $this->courseDataId = $memberCourse->id;
                 $this->updateCourse = true;

+ 1 - 1
app/Http/Livewire/Subscription.php

@@ -66,7 +66,7 @@ class Subscription extends Component
         if (Auth::user()->level != env('LEVEL_ADMIN', 0))
             return redirect()->to('/dashboard');
 
-        $this->course_subscriptions = \App\Models\CourseSubscription::select('*')->where('enabled', true)->get();
+        $this->course_subscriptions = \App\Models\CourseSubscription::select('*')->where('enabled', true)->orderBy('name', 'asc')->get();
     }
 
     public function render()

+ 3 - 3
resources/views/livewire/member.blade.php

@@ -1450,10 +1450,10 @@
                                                 <form class="form--utente">
                                                     <div class="row">
                                                         <div class="col-4 mt-2">
-                                                            <label for="subscription_id" class="form-label">Abbonamento</label><br>
-                                                            <select id="subscription_id" class="form-select" aria-label="Abbonamento" wire:model="subscription_id" >
+                                                            <label for="subscription_id" class="form-label">Tipologia</label><br>
+                                                            <select id="subscription_id" class="form-select" aria-label="Tipologia" wire:model="subscription_id" >
                                                                 <option value=""></option>
-                                                                <option value="course">Abbonamento corso singolo</option>
+                                                                <option value="course">Corso</option>
                                                                 @foreach($subscriptions as $subscription)
                                                                     <option value="{{$subscription->id}}">{{$subscription->name}}</option>
                                                                 @endforeach