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:
co-authored by
Claude Sonnet 4.6
parent
a4ddc63b6f
commit
9a18184ad7
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user