Added parents_only filter to Address/Index

This commit is contained in:
Frank Schubert
2021-06-17 22:46:44 +02:00
parent 8ba7793a66
commit 16d7831d23
6 changed files with 45 additions and 16 deletions

View File

@@ -121,16 +121,21 @@ class AddressModel {
}
//var_dump($filter);exit;
if(array_key_exists("parent_id", $filter)) {
$parentid = $filter['parent_id'];
if($parentid === null) {
if($parentid === null || $parent_id == "null") {
$where .= " AND parent_id IS NULL";
} elseif(is_numeric($parentid)) {
$where .= " AND parent_id=$parentid";
}
}
if(array_key_exists("parents_only", $filter)) {
$po = $filter['parents_only'];
if($po == 1) {
$where .= " AND parent_id IS NULL";
}
}
//var_dump($filter, $where);exit;
return $where;
}