From 024bb06b0f2e2cd4c15211852641ad0500208e1d Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 16 May 2018 11:52:37 +0200 Subject: [PATCH] improved currgeschaeftsjahrquery --- application/models/organisation/Geschaeftsjahr_model.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application/models/organisation/Geschaeftsjahr_model.php b/application/models/organisation/Geschaeftsjahr_model.php index e806058ae..9c856f40e 100644 --- a/application/models/organisation/Geschaeftsjahr_model.php +++ b/application/models/organisation/Geschaeftsjahr_model.php @@ -21,7 +21,9 @@ class Geschaeftsjahr_model extends DB_Model $query = 'SELECT * FROM public.tbl_geschaeftsjahr WHERE start <= now() - AND ende >= now()'; + AND ende >= now() + ORDER BY start DESC + LIMIT 1'; return $this->execQuery($query); }