|
@@ -80,8 +80,8 @@ class PresenceReport extends Component
|
|
|
$presencesAll = \App\Models\Presence::with([
|
|
$presencesAll = \App\Models\Presence::with([
|
|
|
'member:id,first_name,last_name',
|
|
'member:id,first_name,last_name',
|
|
|
'court:id,name',
|
|
'court:id,name',
|
|
|
- 'user:id,name',
|
|
|
|
|
- 'instructor:id,name',
|
|
|
|
|
|
|
+ 'user:id',
|
|
|
|
|
+ 'instructor:id,name,cognome',
|
|
|
'motivation:id,name',
|
|
'motivation:id,name',
|
|
|
'motivationCourse:id,name,course_level_id',
|
|
'motivationCourse:id,name,course_level_id',
|
|
|
'motivationCourse.level:id,name',
|
|
'motivationCourse.level:id,name',
|
|
@@ -291,11 +291,13 @@ class PresenceReport extends Component
|
|
|
|
|
|
|
|
$court = $presence->court?->name ?? '';
|
|
$court = $presence->court?->name ?? '';
|
|
|
|
|
|
|
|
|
|
+ // cerca nel master con ::on('mysql')
|
|
|
|
|
+ $user_instructor = \Illuminate\Foundation\Auth\User::on('mysql')->find($presence->user_id);
|
|
|
|
|
+ $main_instructor = $user_instructor?->name;
|
|
|
|
|
+
|
|
|
$instructorParts = [
|
|
$instructorParts = [
|
|
|
- $presence->user?->name ?? '',
|
|
|
|
|
- ($presence->instructor && $presence->user && $presence->instructor->id !== $presence->user->id)
|
|
|
|
|
- ? $presence->instructor->name
|
|
|
|
|
- : ($presence->instructor?->name ?? ''),
|
|
|
|
|
|
|
+ $main_instructor ?? '',
|
|
|
|
|
+ ($presence->instructor) ? $presence->instructor->name . " " . $presence->instructor->cognome : '',
|
|
|
];
|
|
];
|
|
|
$instructor = implode(', ', array_values(array_filter(array_unique($instructorParts))));
|
|
$instructor = implode(', ', array_values(array_filter(array_unique($instructorParts))));
|
|
|
|
|
|