From 13300577ce4f23f651d7eacb770a05d62e6df0bf Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 15 Jan 2020 15:09:10 +0100 Subject: [PATCH] DowntimeController: Already fetch required relations with the first query --- application/controllers/DowntimeController.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/application/controllers/DowntimeController.php b/application/controllers/DowntimeController.php index 1acf73a4..bdbfaa85 100644 --- a/application/controllers/DowntimeController.php +++ b/application/controllers/DowntimeController.php @@ -23,7 +23,14 @@ class DowntimeController extends Controller $name = $this->params->shiftRequired('name'); - $query = Downtime::on($this->getDb()); + $query = Downtime::on($this->getDb())->with([ + 'host', + 'host.state', + 'service', + 'service.state', + 'service.host', + 'service.host.state' + ]); $query->getSelectBase() ->where(['downtime.name = ?' => $name]);