OPD investigation list: order by id instead of name
This commit is contained in:
parent
6288c626fc
commit
0a48fa6d2c
|
|
@ -7366,10 +7366,11 @@ class Opd_prescription extends BaseController
|
|||
return $this->response->setJSON(['rows' => []]);
|
||||
}
|
||||
|
||||
if (in_array('investigation_name', $fields, true)) {
|
||||
// Keep investigation panel order stable by record id (not alphabetical name).
|
||||
if (in_array('id', $fields, true)) {
|
||||
$builder->orderBy('id', 'ASC');
|
||||
} elseif (in_array('investigation_name', $fields, true)) {
|
||||
$builder->orderBy('investigation_name', 'ASC');
|
||||
} elseif (in_array('id', $fields, true)) {
|
||||
$builder->orderBy('id', 'DESC');
|
||||
}
|
||||
|
||||
$rows = $builder->get()->getResultArray();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user