summaryrefslogtreecommitdiff
path: root/includes/pages/admin_active.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/pages/admin_active.php')
-rw-r--r--includes/pages/admin_active.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/includes/pages/admin_active.php b/includes/pages/admin_active.php
index 18553159..f3a28061 100644
--- a/includes/pages/admin_active.php
+++ b/includes/pages/admin_active.php
@@ -59,7 +59,8 @@ function admin_active()
`User`.*,
COUNT(`ShiftEntry`.`id`) AS `shift_count`,
(%s + (
- SELECT SUM(`work_hours`) * 3600 FROM `UserWorkLog` WHERE `user_id`=`User`.`UID`
+ SELECT COALESCE(SUM(`work_hours`) * 3600, 0) FROM `UserWorkLog` WHERE `user_id`=`User`.`UID`
+ AND `work_timestamp` < %s
)) AS `shift_length`
FROM `User`
LEFT JOIN `ShiftEntry` ON `User`.`UID` = `ShiftEntry`.`UID`
@@ -71,6 +72,7 @@ function admin_active()
%s
',
$shift_sum_formula,
+ time(),
$limit
));
$user_nicks = [];
@@ -143,7 +145,8 @@ function admin_active()
`User`.*,
COUNT(`ShiftEntry`.`id`) AS `shift_count`,
(%s + (
- SELECT SUM(`work_hours`) * 3600 FROM `UserWorkLog` WHERE `user_id`=`User`.`UID`
+ SELECT COALESCE(SUM(`work_hours`) * 3600, 0) FROM `UserWorkLog` WHERE `user_id`=`User`.`UID`
+ AND `work_timestamp` < %s
)) AS `shift_length`
FROM `User` LEFT JOIN `ShiftEntry` ON `User`.`UID` = `ShiftEntry`.`UID`
LEFT JOIN `Shifts` ON `ShiftEntry`.`SID` = `Shifts`.`SID` '
@@ -154,6 +157,7 @@ function admin_active()
%s
',
$shift_sum_formula,
+ time(),
$limit
));
$matched_users = [];