Update Saqel Platform: 2026-08-28 15:13:58
This commit is contained in:
@@ -28,17 +28,12 @@ class ChatController
|
||||
|
||||
$userId = (int)$request->user_id;
|
||||
|
||||
// 1. Fetch all other users in the system
|
||||
// 1. Fetch available teachers and students
|
||||
$users = [];
|
||||
try {
|
||||
$users = Database::select("
|
||||
SELECT u.id as user_id, u.uuid as user_uuid, u.full_name as encrypted_name, u.role as user_role, tp.specialization
|
||||
FROM users u
|
||||
LEFT JOIN teacher_profiles tp ON tp.user_id = u.id
|
||||
WHERE u.id != ?
|
||||
ORDER BY u.id DESC
|
||||
LIMIT 100
|
||||
", [$userId]);
|
||||
$teachers = Database::select("SELECT id as user_id, uuid as user_uuid, full_name as encrypted_name, 'teacher' as user_role, specialization FROM teachers WHERE id != ? LIMIT 50", [$userId]);
|
||||
$students = Database::select("SELECT id as user_id, uuid as user_uuid, full_name as encrypted_name, 'student' as user_role, 'طالب' as specialization FROM students WHERE id != ? LIMIT 50", [$userId]);
|
||||
$users = array_merge($teachers, $students);
|
||||
} catch (\Throwable $e) {
|
||||
error_log("Users select in getConversations error: " . $e->getMessage());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user