diff --git a/application/Building/BuildingModel.php b/application/Building/BuildingModel.php index 2b23a63b2..7f95bd80d 100644 --- a/application/Building/BuildingModel.php +++ b/application/Building/BuildingModel.php @@ -290,7 +290,7 @@ class BuildingModel { wv.value_text, (wv.create) AS created_at, wv.create_by AS created_by_user_id, - (wv.edit) AS last_edited_at, + wv.changed AS last_edited_at, wv.edit_by AS last_edited_by_user_id FROM Workflowvalue wv JOIN Workflowitem wi ON wv.item_id = wi.id @@ -298,7 +298,7 @@ JOIN Building b ON wv.object_id = b.id"; $where = ["wi.object_type = 'Building'", "wi.num < 150"]; if ($from !== null && $to !== null) { - $where[] = "((wv.create >= " . intval($from) . " AND wv.create <= " . intval($to) . ") OR (wv.edit >= " . intval($from) . " AND wv.edit <= " . intval($to) . "))"; + $where[] = "(wv.changed >= " . intval($from) . " AND wv.changed <= " . intval($to) . ")"; } if ($network_id !== null) { $where[] = "b.network_id = " . intval($network_id);