fix(legacy): advanced search by track type id

Advanced where clause didn't support matching primary keys.

Fixes #2344
This commit is contained in:
jo 2023-01-08 17:44:15 +01:00 committed by Kyle Robbertze
parent 87bc388c3e
commit fcfe52ec9d
1 changed files with 7 additions and 2 deletions

View File

@ -50,8 +50,13 @@ class Application_Model_Datatables
}
} else {
if (trim($input1) !== '') {
$where['clause'][$dbname] = $dbname . ' ILIKE :' . $dbname . '1';
$where['params'][$dbname . '1'] = '%' . $input1 . '%';
if ($dbname == 'track_type_id') {
$where['clause'][$dbname] = $dbname . ' = :' . $dbname . '1';
$where['params'][$dbname . '1'] = $input1;
} else {
$where['clause'][$dbname] = $dbname . ' ILIKE :' . $dbname . '1';
$where['params'][$dbname . '1'] = '%' . $input1 . '%';
}
}
}
}