diff --git a/backend/app/Services/TeacherRatingService.php b/backend/app/Services/TeacherRatingService.php index 8036efb..22c0de6 100644 --- a/backend/app/Services/TeacherRatingService.php +++ b/backend/app/Services/TeacherRatingService.php @@ -431,7 +431,7 @@ class TeacherRatingService $teachers = Database::select( "SELECT u.id, u.full_name, u.phone_number, - tp.specialization, tp.bio, tp.rating as legacy_rating, + tp.specialization, tp.bio, m.avg_response_minutes, m.response_rate_percentage, m.active_queue_count, m.total_students_enrolled, m.total_reviews_count, m.weighted_student_rating, m.composite_merit_score, m.star_equivalent, m.reputation_tier, @@ -444,6 +444,12 @@ class TeacherRatingService ); foreach ($teachers as &$t) { + $rawName = (string)($t['full_name'] ?? ''); + $t['full_name'] = \App\Core\Security::decrypt($rawName) ?: $rawName; + if (empty($t['full_name'])) { + $t['full_name'] = 'الأستاذ المعتمد'; + } + if (empty($t['composite_merit_score'])) { $metrics = self::recalculateTeacherMetrics((int)$t['id']); $t['composite_merit_score'] = $metrics['composite_merit_score'];