fix: dynamic ABHA column SELECT in createOpdPrescriptionWorkTask (unknown column abha_no)
This commit is contained in:
parent
e049ddcf2b
commit
7e16ac92c2
|
|
@ -7806,8 +7806,11 @@ OPD SNAPSHOT JSON: " . $payload;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$pmFields = $this->db->getFieldNames('patient_master') ?? [];
|
||||||
|
$abhaCols = array_filter(['abha_id', 'abha_no', 'abha_address', 'abha'], fn ($c) => in_array($c, $pmFields, true));
|
||||||
|
$abhaSelect = $abhaCols ? (', ' . implode(', ', $abhaCols)) : '';
|
||||||
$patient = $this->db->table('patient_master')
|
$patient = $this->db->table('patient_master')
|
||||||
->select('p_fname,abha_id,abha_no,abha_address,abha')
|
->select('p_fname' . $abhaSelect)
|
||||||
->where('id', $patientId)
|
->where('id', $patientId)
|
||||||
->get(1)
|
->get(1)
|
||||||
->getRowArray();
|
->getRowArray();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user