Added more filtering to Preorder/Index

This commit is contained in:
Frank Schubert
2023-04-24 13:26:55 +02:00
parent 9f96fc4cf1
commit f89909014a
7 changed files with 33 additions and 8 deletions

View File

@@ -65,7 +65,7 @@ class NetworkModel {
}
public static function getFirst() {
public static function getFirst($filter = false) {
$db = FronkDB::singleton();
$where = self::getSqlFilter($filter);
@@ -124,6 +124,15 @@ class NetworkModel {
}
}
if(array_key_exists("adb_network_id", $filter)) {
$adb_network_id = $filter['adb_network_id'];
if(is_numeric($adb_network_id)) {
$where .= " AND adb_network_id=$adb_network_id";
} elseif(is_array($adb_network_id) && count($adb_network_id)) {
$where .= " AND adb_network_id IN (". implode(",", $adb_network_id).")";
}
}
//var_dump($filter, $where);exit;