Update Saqel Platform: 2026-08-28 04:58:01
This commit is contained in:
@@ -68,6 +68,12 @@ class TeacherRatingService
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
");
|
||||
|
||||
// Check and automatically add active_queue_count if missing from existing table
|
||||
$colsMetrics = Database::select("SHOW COLUMNS FROM teacher_performance_metrics LIKE 'active_queue_count'");
|
||||
if (empty($colsMetrics)) {
|
||||
Database::query("ALTER TABLE teacher_performance_metrics ADD COLUMN active_queue_count INT UNSIGNED NOT NULL DEFAULT 0 AFTER response_rate_percentage");
|
||||
}
|
||||
|
||||
self::$schemaChecked = true;
|
||||
} catch (\Throwable $e) {
|
||||
error_log("TeacherRatingService schema note: " . $e->getMessage());
|
||||
@@ -432,7 +438,7 @@ class TeacherRatingService
|
||||
$teachers = Database::select(
|
||||
"SELECT u.id, u.full_name, u.phone_number,
|
||||
tp.specialization, tp.bio,
|
||||
m.avg_response_minutes, m.response_rate_percentage, m.active_queue_count, m.total_students_enrolled,
|
||||
m.avg_response_minutes, m.response_rate_percentage, m.total_students_enrolled,
|
||||
m.total_reviews_count, m.weighted_student_rating, m.composite_merit_score,
|
||||
m.star_equivalent, m.reputation_tier,
|
||||
(SELECT COUNT(*) FROM lessons WHERE course_id IN (SELECT id FROM courses WHERE teacher_id = u.id)) as lessons_count
|
||||
|
||||
Reference in New Issue
Block a user