|
@@ -33,6 +33,7 @@ class CourseList extends Component
|
|
|
|
|
|
|
|
public $courseId = 0;
|
|
public $courseId = 0;
|
|
|
|
|
|
|
|
|
|
+ public $filterYear = '';
|
|
|
public $filterCourse = [];
|
|
public $filterCourse = [];
|
|
|
public $filterLevel = [];
|
|
public $filterLevel = [];
|
|
|
public $filterFrequency = [];
|
|
public $filterFrequency = [];
|
|
@@ -66,11 +67,20 @@ class CourseList extends Component
|
|
|
|
|
|
|
|
$this->courses = \App\Models\Course::orderBy('name')->groupBy('name')->pluck('name');
|
|
$this->courses = \App\Models\Course::orderBy('name')->groupBy('name')->pluck('name');
|
|
|
|
|
|
|
|
|
|
+ if (date("m") >= env('FISCAL_YEAR_MONTH_FROM', 1))
|
|
|
|
|
+ $this->filterYear = date("Y") . "-" . (date("Y") + 1);
|
|
|
|
|
+ else
|
|
|
|
|
+ $this->filterYear = (date("Y") - 1) . "-" . date("Y");
|
|
|
|
|
+
|
|
|
//if (sizeof($this->courses) > 0)
|
|
//if (sizeof($this->courses) > 0)
|
|
|
// $this->courseId = $this->courses[0]->id;
|
|
// $this->courseId = $this->courses[0]->id;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public function updatedfilterYear($value){
|
|
|
|
|
+ $this->emit('load-data-table');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public function updatedfilterCourse($value){
|
|
public function updatedfilterCourse($value){
|
|
|
$this->emit('load-data-table');
|
|
$this->emit('load-data-table');
|
|
|
}
|
|
}
|
|
@@ -117,6 +127,12 @@ class CourseList extends Component
|
|
|
$member_course = $member_course->whereIn('member_id', $member_ids);
|
|
$member_course = $member_course->whereIn('member_id', $member_ids);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if ($this->filterYear != "")
|
|
|
|
|
+ {
|
|
|
|
|
+ $course_ids = \App\Models\Course::where('year', $this->filterYear)->pluck('id');
|
|
|
|
|
+ $member_course = $member_course->whereIn('course_id', $course_ids);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if ($this->hasFilter)
|
|
if ($this->hasFilter)
|
|
|
{
|
|
{
|
|
|
if (isset($_GET["search"]["value"]))
|
|
if (isset($_GET["search"]["value"]))
|
|
@@ -139,6 +155,8 @@ class CourseList extends Component
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
if (sizeof($this->filterCourse) > 0)
|
|
if (sizeof($this->filterCourse) > 0)
|
|
|
{
|
|
{
|
|
|
$course_ids = [];
|
|
$course_ids = [];
|