diff --git a/application/Timerecording/TimerecordingModel.php b/application/Timerecording/TimerecordingModel.php index 7b83a7a1e..cfd5833e7 100644 --- a/application/Timerecording/TimerecordingModel.php +++ b/application/Timerecording/TimerecordingModel.php @@ -164,7 +164,7 @@ class TimerecordingModel $endtime = $filter['endtime']; $id = $filter['id']; if (is_numeric($starttime) && is_numeric($endtime)) { - $where .= " AND (((`start` <= $starttime AND `end` >= $starttime ) OR (`start` >= $endtime AND `end` <= $endtime) OR (`start` >= $starttime AND `end` >= $starttime AND `start` <= $endtime AND `end` <= $endtime) OR (`start` >= $starttime AND `end` >= $starttime AND `start` <= $endtime AND `end` >= $endtime)) OR ( `start` <= $starttime AND `end` IS NULL)) ORDER by user_id ASC"; + $where .= " AND (((`start` <= $starttime AND `end` > $starttime ) OR (`start` > $endtime AND `end` < $endtime) OR (`start` > $starttime AND `end` > $starttime AND `start` <= $endtime AND `end` < $endtime) OR (`start` > $starttime AND `end` > $starttime AND `start` < $endtime AND `end` > $endtime) OR (`start` = $starttime AND `end` = $endtime )) OR ( `start` <= $starttime AND `end` IS NULL)) ORDER by user_id ASC"; if ($id && is_numeric($id)) { $where .= " AND `id` != $id"; }