|
@@ -10,7 +10,7 @@ class CourseMember extends Component
|
|
|
public $records = array();
|
|
public $records = array();
|
|
|
|
|
|
|
|
public $courses = [];
|
|
public $courses = [];
|
|
|
- public $course_durations = [];
|
|
|
|
|
|
|
+ public $course_frequencies = [];
|
|
|
public $course_types = [];
|
|
public $course_types = [];
|
|
|
public $course_levels = [];
|
|
public $course_levels = [];
|
|
|
public $course_years = [];
|
|
public $course_years = [];
|
|
@@ -18,7 +18,7 @@ class CourseMember extends Component
|
|
|
public $filterCourse = "";
|
|
public $filterCourse = "";
|
|
|
public $filterLevel = "";
|
|
public $filterLevel = "";
|
|
|
public $filterType = "";
|
|
public $filterType = "";
|
|
|
- public $filterDuration = "";
|
|
|
|
|
|
|
+ public $filterFrequency = "";
|
|
|
public $filterDays = "";
|
|
public $filterDays = "";
|
|
|
public $filterHours = "";
|
|
public $filterHours = "";
|
|
|
public $filterSubscription = "";
|
|
public $filterSubscription = "";
|
|
@@ -37,7 +37,7 @@ class CourseMember extends Component
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
$this->course_types = \App\Models\CourseType::select('*')->where('enabled', true)->get();
|
|
$this->course_types = \App\Models\CourseType::select('*')->where('enabled', true)->get();
|
|
|
- $this->course_durations = \App\Models\CourseDuration::select('*')->where('enabled', true)->get();
|
|
|
|
|
|
|
+ $this->course_frequencies = \App\Models\CourseFrequency::select('*')->where('enabled', true)->get();
|
|
|
$this->course_levels = \App\Models\CourseLevel::select('*')->where('enabled', true)->get();
|
|
$this->course_levels = \App\Models\CourseLevel::select('*')->where('enabled', true)->get();
|
|
|
$this->course_years = \App\Models\Course::select('year')->where('year', '<>', '')->groupBy('year')->pluck('year');
|
|
$this->course_years = \App\Models\Course::select('year')->where('year', '<>', '')->groupBy('year')->pluck('year');
|
|
|
$this->courses = \App\Models\Course::orderBy('name')->groupBy('name')->pluck('name');
|
|
$this->courses = \App\Models\Course::orderBy('name')->groupBy('name')->pluck('name');
|
|
@@ -71,31 +71,32 @@ class CourseMember extends Component
|
|
|
$this->filter .= $this->filter != '' ? ', ' : '';
|
|
$this->filter .= $this->filter != '' ? ', ' : '';
|
|
|
$this->filter .= "Tipologia : " . \App\Models\CourseType::findOrFail($this->filterType)->name . " ";
|
|
$this->filter .= "Tipologia : " . \App\Models\CourseType::findOrFail($this->filterType)->name . " ";
|
|
|
}
|
|
}
|
|
|
- if ($this->filterDuration != "")
|
|
|
|
|
|
|
+ if ($this->filterFrequency != "")
|
|
|
{
|
|
{
|
|
|
- $course_ids = \App\Models\Course::where('course_duration_id', $this->filterDuration)->pluck('id');
|
|
|
|
|
|
|
+ $course_ids = \App\Models\Course::where('course_frequency_id', $this->filterFrequency)->pluck('id');
|
|
|
$datas = $datas->whereIn('course_id', $course_ids);
|
|
$datas = $datas->whereIn('course_id', $course_ids);
|
|
|
$this->filter .= $this->filter != '' ? ', ' : '';
|
|
$this->filter .= $this->filter != '' ? ', ' : '';
|
|
|
- $this->filter .= "Durata : " . \App\Models\CourseDuration::findOrFail($this->filterDuration)->name . " ";
|
|
|
|
|
|
|
+ $this->filter .= "Durata : " . \App\Models\CourseFrequency::findOrFail($this->filterFrequency)->name . " ";
|
|
|
}
|
|
}
|
|
|
if ($this->filterDays != "")
|
|
if ($this->filterDays != "")
|
|
|
{
|
|
{
|
|
|
- $course_ids = \App\Models\MemberCourse::where('when', 'like', "%" . $this->filterDays . "%")->pluck('course_id');
|
|
|
|
|
- $datas = $datas->whereIn('course_id', $course_ids);
|
|
|
|
|
|
|
+ $members_ids = \App\Models\MemberCourse::where('when', 'like', "%" . $this->filterDays . "%")->pluck('member_id');
|
|
|
|
|
+ $datas = $datas->whereIn('member_id', $members_ids);
|
|
|
$this->filter .= $this->filter != '' ? ', ' : '';
|
|
$this->filter .= $this->filter != '' ? ', ' : '';
|
|
|
$this->filter .= "Giorni : " . $this->filterDays . " ";
|
|
$this->filter .= "Giorni : " . $this->filterDays . " ";
|
|
|
}
|
|
}
|
|
|
if ($this->filterHours != "")
|
|
if ($this->filterHours != "")
|
|
|
{
|
|
{
|
|
|
- $course_ids = \App\Models\MemberCourse::where('when', 'like', "%" . $this->filterHours . "%")->pluck('course_id');
|
|
|
|
|
- $datas = $datas->whereIn('course_id', $course_ids);
|
|
|
|
|
|
|
+ $members_ids = \App\Models\MemberCourse::where('when', 'like', '%"from":"' . $this->filterHours . "%")->pluck('member_id');
|
|
|
|
|
+ $datas = $datas->whereIn('member_id', $members_ids);
|
|
|
$this->filter .= $this->filter != '' ? ', ' : '';
|
|
$this->filter .= $this->filter != '' ? ', ' : '';
|
|
|
$this->filter .= "Ore : " . $this->filterHours . " ";
|
|
$this->filter .= "Ore : " . $this->filterHours . " ";
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
if ($this->filterSubscription != "")
|
|
if ($this->filterSubscription != "")
|
|
|
{
|
|
{
|
|
|
- $course_ids = \App\Models\MemberCourse::where('subscribed', $this->filterSubscription == 1 ? true : false)->pluck('id');
|
|
|
|
|
- $datas = $datas->whereIn('course_id', $course_ids);
|
|
|
|
|
|
|
+ $ids = \App\Models\MemberCourse::where('subscribed', $this->filterSubscription == 1 ? true : false)->pluck('id');
|
|
|
|
|
+ $datas = $datas->whereIn('id', $ids);
|
|
|
$this->filter .= $this->filter != '' ? ', ' : '';
|
|
$this->filter .= $this->filter != '' ? ', ' : '';
|
|
|
$this->filter .= "Pagata sottoscrizione : " . ($this->filterSubscription == 1 ? "SI" : "NO") . " ";
|
|
$this->filter .= "Pagata sottoscrizione : " . ($this->filterSubscription == 1 ? "SI" : "NO") . " ";
|
|
|
}
|
|
}
|
|
@@ -179,7 +180,7 @@ class CourseMember extends Component
|
|
|
$this->filterCourse = "";
|
|
$this->filterCourse = "";
|
|
|
$this->filterLevel = "";
|
|
$this->filterLevel = "";
|
|
|
$this->filterType = "";
|
|
$this->filterType = "";
|
|
|
- $this->filterDuration = "";
|
|
|
|
|
|
|
+ $this->filterFrequency = "";
|
|
|
$this->filterDays = "";
|
|
$this->filterDays = "";
|
|
|
$this->filterHours = "";
|
|
$this->filterHours = "";
|
|
|
$this->filterSubscription = "";
|
|
$this->filterSubscription = "";
|