|
|
@@ -93,8 +93,15 @@ class Presence extends Component
|
|
|
// ->whereIn('course_id', $courses)
|
|
|
// ->pluck('member_id')->toArray();
|
|
|
|
|
|
- $members_courses = \App\Models\MemberCourse::whereRaw("JSON_CONTAINS(`when`, JSON_OBJECT('day', JSON_ARRAY(?), 'from', ?), '$')", [$d, $h])->where('months', 'like', '%"m":' . $months . ',%')->whereIn('course_id', $courses)->pluck('member_id')->toArray();
|
|
|
-
|
|
|
+ // $members_courses = \App\Models\MemberCourse::whereRaw("JSON_CONTAINS(`when`, JSON_OBJECT('day', JSON_ARRAY(?), 'from', ?), '$')", [$d, $h])->where('months', 'like', '%"m":' . $months . ',%')->whereIn('course_id', $courses)->pluck('member_id')->toArray();
|
|
|
+ $members_courses = \App\Models\MemberCourse::query()
|
|
|
+ ->whereRaw("JSON_CONTAINS(`when`, JSON_OBJECT('day', JSON_ARRAY(?), 'from', ?), '$')", [$d, $h])
|
|
|
+ ->whereRaw("JSON_CONTAINS(months, JSON_OBJECT('m', CAST(? AS UNSIGNED)), '$')", [$months])
|
|
|
+ ->whereRaw("NOT JSON_CONTAINS(months, JSON_OBJECT('m', CAST(? AS UNSIGNED), 'status', 2), '$')", [$months])
|
|
|
+ ->whereRaw("NOT JSON_CONTAINS(months, JSON_OBJECT('m', CAST(? AS UNSIGNED), 'status', '2'), '$')", [$months])
|
|
|
+ ->whereIn('course_id', $courses)
|
|
|
+ ->pluck('member_id')
|
|
|
+ ->toArray();
|
|
|
|
|
|
if ($this->filter != '') {
|
|
|
$filter = $this->filter;
|