feat(pacientes): verificar WhatsApp al ingresar teléfono, vincular user_id al guardar
fix(recepcion): mostrar nombre_completo en resultados de búsqueda de paciente Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
018d445846
commit
af584bcc26
@@ -51,6 +51,15 @@ try {
|
||||
}
|
||||
// ────────────────────────────────────────────────────────────────────────
|
||||
|
||||
// Auto-vincular user_id por teléfono si no viene explícito
|
||||
if (empty($datos['user_id']) && !empty($telVal)) {
|
||||
$pdo = db();
|
||||
$stmt = $pdo->prepare("SELECT id FROM users WHERE phone_number = ? LIMIT 1");
|
||||
$stmt->execute([$telVal]);
|
||||
$wid = $stmt->fetchColumn();
|
||||
if ($wid) $datos['user_id'] = (int)$wid;
|
||||
}
|
||||
|
||||
$pac = new Paciente();
|
||||
$admin = adminId();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user