summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2018-12-27 19:53:48 +0100
committermsquare <msquare@notrademark.de>2018-12-27 19:53:48 +0100
commit794df6f99e9e24a605dbe3998cf5d67b5bc8c4d9 (patch)
tree741e473de1a6af368a386d08b6e04a3a5d4e2755 /includes
parentdb26412e6c155a40bca58cf2982911e1f3fb370c (diff)
fixes #548: users with only worklog and no shifts had 0 minutes on admin-active. query fixed
Diffstat (limited to 'includes')
-rw-r--r--includes/model/User_model.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/includes/model/User_model.php b/includes/model/User_model.php
index 8a7ee517..d47b2915 100644
--- a/includes/model/User_model.php
+++ b/includes/model/User_model.php
@@ -262,11 +262,11 @@ function User_get_shifts_sum_query()
{
$nightShifts = config('night_shifts');
if (!$nightShifts['enabled']) {
- return 'SUM(`end` - `start`)';
+ return 'COALESCE(SUM(`end` - `start`), 0)';
}
return sprintf('
- SUM(
+ COALESCE(SUM(
(1 +
(
(HOUR(FROM_UNIXTIME(`Shifts`.`end`)) > %1$d AND HOUR(FROM_UNIXTIME(`Shifts`.`end`)) < %2$d)
@@ -276,7 +276,7 @@ function User_get_shifts_sum_query()
)
* (`Shifts`.`end` - `Shifts`.`start`)
* (1 - (%3$d + 1) * `ShiftEntry`.`freeloaded`)
- )
+ ), 0)
',
$nightShifts['start'],
$nightShifts['end'],