diff options
author | msquare <msquare@notrademark.de> | 2017-12-29 18:57:11 +0100 |
---|---|---|
committer | msquare <msquare@notrademark.de> | 2017-12-29 18:57:11 +0100 |
commit | ee9fbda098b3c608176ced4425765e3029ca8f93 (patch) | |
tree | 5bfe5bbdb55e644d1f3f321ef44747fa420839d9 /includes/pages | |
parent | d95e48889356eab85aff5ae7121aeb18115aef95 (diff) |
add work date to work log
Diffstat (limited to 'includes/pages')
-rw-r--r-- | includes/pages/admin_active.php | 8 |
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 = []; |