Added parents_only filter to Address/Index
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user