Corrección de búsqueda por nombre: inclusión del rol coordinador en el filtro
This commit is contained in:
@@ -212,7 +212,7 @@ class TelegramBot {
|
|||||||
return "Error de conexion.";
|
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%"]);
|
$stmt->execute(["%$nombre%"]);
|
||||||
$user = $stmt->fetch();
|
$user = $stmt->fetch();
|
||||||
|
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ class TurnoBot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
log_timing("handleUpdate: DB query start");
|
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%"]);
|
$stmt->execute(["%$text%", "%$text%"]);
|
||||||
$user = $stmt->fetch();
|
$user = $stmt->fetch();
|
||||||
log_timing("handleUpdate: DB query end");
|
log_timing("handleUpdate: DB query end");
|
||||||
|
|||||||
Reference in New Issue
Block a user