|
|
@@ -77,7 +77,8 @@ class PresenceReport extends Component
|
|
|
'user:id,name',
|
|
|
'instructor:id,name',
|
|
|
'motivation:id,name',
|
|
|
- 'motivationCourse:id,name',
|
|
|
+ 'motivationCourse:id,name,course_level_id',
|
|
|
+ 'motivationCourse.level:id,name',
|
|
|
])
|
|
|
->whereIn('calendar_id', $calendarIds)
|
|
|
->when(!empty($this->court_id), fn($q) => $q->where('court_id', (int)$this->court_id))
|
|
|
@@ -154,7 +155,7 @@ class PresenceReport extends Component
|
|
|
|
|
|
$p = $presenceByCalMember[$calendar->id . '|' . $mid] ?? null;
|
|
|
|
|
|
- [$court, $instructor, $motivation] = $this->presenceMeta($p);
|
|
|
+ [$court, $instructor, $motivation, $motivation_course] = $this->presenceMeta($p);
|
|
|
|
|
|
$status = $this->presenceStatusHtml($p, $calendar);
|
|
|
|
|
|
@@ -188,13 +189,16 @@ class PresenceReport extends Component
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- [$court, $instructor, $motivation] = $this->presenceMeta($p);
|
|
|
+ [$court, $instructor, $motivation, $motivation_course] = $this->presenceMeta($p);
|
|
|
$status = $this->presenceStatusHtml($p, $calendar);
|
|
|
|
|
|
$course_level = '';
|
|
|
if ($calendar->course && $calendar->course->level) {
|
|
|
$course_level = trim($calendar->course->level->name);
|
|
|
}
|
|
|
+ if ($motivation_course) {
|
|
|
+ $course_level = $motivation_course->level?->name;
|
|
|
+ }
|
|
|
|
|
|
$this->records[$calendar->name][$h][] = [
|
|
|
'course_level' => $course_level,
|
|
|
@@ -247,7 +251,7 @@ class PresenceReport extends Component
|
|
|
|
|
|
protected function presenceMeta($presence): array
|
|
|
{
|
|
|
- if (!$presence) return ['', '', ''];
|
|
|
+ if (!$presence) return ['', '', '', null];
|
|
|
|
|
|
$court = $presence->court?->name ?? '';
|
|
|
|
|
|
@@ -261,7 +265,9 @@ class PresenceReport extends Component
|
|
|
|
|
|
$motivation = $presence->motivation?->name ?? '';
|
|
|
|
|
|
- return [$court, $instructor, $motivation];
|
|
|
+ $motivation_course = $presence->motivationCourse ?? null;
|
|
|
+
|
|
|
+ return [$court, $instructor, $motivation, $motivation_course];
|
|
|
}
|
|
|
|
|
|
public function prev()
|