fix(patient): avoid queue_no select on legacy opd_master schema

This commit is contained in:
DevSoftTech Server 2026-05-31 21:02:55 +05:30
parent 8f16f1e6ec
commit 701111b75e

View File

@ -853,8 +853,17 @@ class Patient extends BaseController
return $this->response->setStatusCode(404)->setBody('Patient not found');
}
$opdFields = $this->db->getFieldNames('opd_master') ?? [];
$opdSelect = [
'opd_id',
'opd_code',
'doc_name',
'apointment_date',
];
$opdSelect[] = in_array('queue_no', $opdFields, true) ? 'queue_no' : "'' AS queue_no";
$opdList = $this->db->table('opd_master')
->select('opd_id, opd_code, doc_name, apointment_date, queue_no')
->select(implode(', ', $opdSelect), false)
->where('p_id', $pno)
->orderBy('opd_id', 'DESC')
->get()