Corrección de búsqueda por nombre: inclusión del rol coordinador en el filtro

This commit is contained in:
nickpons666
2026-01-31 02:23:45 -06:00
parent fefd3a8d78
commit b000e7f665
2 changed files with 2 additions and 2 deletions

View File

@@ -212,7 +212,7 @@ class TelegramBot {
return "Error de conexion.";
}
$stmt = $pdo->prepare("SELECT * FROM users WHERE nombre LIKE ? AND rol = 'ayudante' AND activo = 1 LIMIT 1");
$stmt = $pdo->prepare("SELECT * FROM users WHERE nombre LIKE ? AND (rol = 'ayudante' OR rol = 'coordinador') AND activo = 1 LIMIT 1");
$stmt->execute(["%$nombre%"]);
$user = $stmt->fetch();

View File

@@ -116,7 +116,7 @@ class TurnoBot {
}
log_timing("handleUpdate: DB query start");
$stmt = $pdo->prepare("SELECT * FROM users WHERE (nombre LIKE ? OR username LIKE ?) AND rol = 'ayudante' AND activo = 1 LIMIT 1");
$stmt = $pdo->prepare("SELECT * FROM users WHERE (nombre LIKE ? OR username LIKE ?) AND (rol = 'ayudante' OR rol = 'coordinador') AND activo = 1 LIMIT 1");
$stmt->execute(["%$text%", "%$text%"]);
$user = $stmt->fetch();
log_timing("handleUpdate: DB query end");