added pipework history job

This commit is contained in:
Luca Haid
2025-04-14 13:12:45 +02:00
parent 3b4200de52
commit 1563c8922e
2 changed files with 84 additions and 7 deletions

View File

@@ -115,7 +115,6 @@ class BuildingModel {
LEFT JOIN Buildingstatus ON (Buildingstatus.id = Building.status_id)
WHERE $where
ORDER BY network_id, pop_id, street, zip, city";
mfLoghandler::singleton()->debug($sql);
if(is_array($limit) && count($limit)) {
if(is_numeric($limit['start']) && is_numeric($limit['count'])) {
@@ -270,6 +269,13 @@ class BuildingModel {
$where .= " AND city like '$city'";
}
}
if(array_key_exists(">create", $filter)) {
$create = FronkDB::singleton()->escape($filter[">create"]);
if($create) {
$where .= " AND Building.`create` > $create";
}
}
//var_dump($filter, $where);exit;
return $where;
@@ -283,6 +289,7 @@ class BuildingModel {
wi.id AS item_id,
wi.name AS item_name,
wi.num AS item_num,
wi.object_type AS item_object_type,
wi.label AS item_label,
wi.type AS item_type,
wv.id AS value_id,
@@ -294,7 +301,7 @@ class BuildingModel {
FROM Workflowvalue wv
JOIN Workflowitem wi ON wv.item_id = wi.id
JOIN Building b ON wv.object_id = b.id";
$where = ["wi.object_type = 'Building'", "wi.name NOT LIKE '%delimiter%'"];
$where = ["wi.name NOT LIKE '%delimiter%'"];
if ($from !== null && $to !== null) {
$where[] = "(wv.changed >= " . intval($from) . " AND wv.changed <= " . intval($to) . ")";