diff options
author | msquare <msquare@notrademark.de> | 2017-12-26 17:35:34 +0100 |
---|---|---|
committer | msquare <msquare@notrademark.de> | 2017-12-26 17:35:34 +0100 |
commit | 96d4968e1d9427b646f970a8184495b73ff5d856 (patch) | |
tree | 8253a63e4a19a9ed146c1eb1cb949d1e37cb1148 /includes | |
parent | bf7474b3d3c518fff8957a4c2cfdc940091c8c4f (diff) |
fix dashboard stats
Diffstat (limited to 'includes')
-rw-r--r-- | includes/model/Stats.php | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/includes/model/Stats.php b/includes/model/Stats.php index 94bb70ce..20376ac6 100644 --- a/includes/model/Stats.php +++ b/includes/model/Stats.php @@ -78,12 +78,12 @@ function stats_angels_needed_three_hours() SELECT SUM(`count`) FROM `NeededAngelTypes` JOIN `AngelTypes` ON `AngelTypes`.`id`=`NeededAngelTypes`.`angel_type_id` - WHERE `AngelTypes`.`show_on_dashboard`=FALSE + WHERE `AngelTypes`.`show_on_dashboard`=TRUE AND `NeededAngelTypes`.`shift_id`=`Shifts`.`SID` ) - ( SELECT COUNT(*) FROM `ShiftEntry` JOIN `AngelTypes` ON `AngelTypes`.`id`=`ShiftEntry`.`TID` - WHERE `AngelTypes`.`show_on_dashboard`=FALSE + WHERE `AngelTypes`.`show_on_dashboard`=TRUE AND `ShiftEntry`.`SID`=`Shifts`.`SID` AND `freeloaded`=0 ) @@ -101,12 +101,12 @@ function stats_angels_needed_three_hours() SELECT SUM(`count`) FROM `NeededAngelTypes` JOIN `AngelTypes` ON `AngelTypes`.`id`=`NeededAngelTypes`.`angel_type_id` - WHERE `AngelTypes`.`show_on_dashboard`=FALSE + WHERE `AngelTypes`.`show_on_dashboard`=TRUE AND `NeededAngelTypes`.`room_id`=`Shifts`.`RID` ) - ( SELECT COUNT(*) FROM `ShiftEntry` JOIN `AngelTypes` ON `AngelTypes`.`id`=`ShiftEntry`.`TID` - WHERE `AngelTypes`.`show_on_dashboard`=FALSE + WHERE `AngelTypes`.`show_on_dashboard`=TRUE AND `ShiftEntry`.`SID`=`Shifts`.`SID` AND `freeloaded`=0 ) @@ -147,12 +147,12 @@ function stats_angels_needed_for_nightshifts() SELECT SUM(`count`) FROM `NeededAngelTypes` JOIN `AngelTypes` ON `AngelTypes`.`id`=`NeededAngelTypes`.`angel_type_id` - WHERE `AngelTypes`.`show_on_dashboard`=FALSE + WHERE `AngelTypes`.`show_on_dashboard`=TRUE AND `NeededAngelTypes`.`shift_id`=`Shifts`.`SID` ) - ( SELECT COUNT(*) FROM `ShiftEntry` JOIN `AngelTypes` ON `AngelTypes`.`id`=`ShiftEntry`.`TID` - WHERE `AngelTypes`.`show_on_dashboard`=FALSE + WHERE `AngelTypes`.`show_on_dashboard`=TRUE AND `ShiftEntry`.`SID`=`Shifts`.`SID` AND `freeloaded`=0 ) @@ -170,12 +170,12 @@ function stats_angels_needed_for_nightshifts() SELECT SUM(`count`) FROM `NeededAngelTypes` JOIN `AngelTypes` ON `AngelTypes`.`id`=`NeededAngelTypes`.`angel_type_id` - WHERE `AngelTypes`.`show_on_dashboard`=FALSE + WHERE `AngelTypes`.`show_on_dashboard`=TRUE AND `NeededAngelTypes`.`room_id`=`Shifts`.`RID` ) - ( SELECT COUNT(*) FROM `ShiftEntry` JOIN `AngelTypes` ON `AngelTypes`.`id`=`ShiftEntry`.`TID` - WHERE `AngelTypes`.`show_on_dashboard`=FALSE + WHERE `AngelTypes`.`show_on_dashboard`=TRUE AND `ShiftEntry`.`SID`=`Shifts`.`SID` AND `freeloaded`=0 ) |