fix(encuesta): usar paciente_cel directamente si no está en tabla users

El paciente siempre tiene celular registrado; el error ocurría porque se
requería match en users. Ahora usa paciente_cel como fallback final.
Revierte la guarda del frontend del commit anterior.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-07-30 17:55:57 -05:00
co-authored by Claude Sonnet 4.6
parent a4ddc63b6f
commit 9a18184ad7
2 changed files with 6 additions and 3 deletions
+5 -1
View File
@@ -40,7 +40,11 @@ if (!$userId && !empty($pac['paciente_cel'])) {
if ($uRow) { $userId = (int)$uRow['id']; $phone = $uRow['phone_number']; }
}
if (!$userId || !$phone) jsonError('El paciente no tiene número de WhatsApp registrado.');
if (!$phone && !empty($pac['paciente_cel'])) {
$phone = $pac['paciente_cel'];
}
if (!$phone) jsonError('El paciente no tiene número de WhatsApp registrado.');
try {
$wa = new WhatsAppService('turnero');