api all shifts export should only show needed angeltypes with count greater than 0

This commit is contained in:
Philip Häusler 2013-12-09 17:24:54 +01:00
parent 4aa85a3ff2
commit 3bc9d09f7a
1 changed files with 3 additions and 2 deletions

View File

@ -10,8 +10,9 @@ function NeededAngelTypes_by_shift($shift) {
SELECT `NeededAngelTypes`.*, `AngelTypes`.`name`, `AngelTypes`.`restricted` SELECT `NeededAngelTypes`.*, `AngelTypes`.`name`, `AngelTypes`.`restricted`
FROM `NeededAngelTypes` FROM `NeededAngelTypes`
JOIN `AngelTypes` ON `AngelTypes`.`id` = `NeededAngelTypes`.`angel_type_id` JOIN `AngelTypes` ON `AngelTypes`.`id` = `NeededAngelTypes`.`angel_type_id`
WHERE `shift_id`=" . sql_escape($shift['SID']) . " WHERE (`shift_id`=" . sql_escape($shift['SID']) . "
OR `room_id`=" . sql_escape($shift['RID']) . " OR `room_id`=" . sql_escape($shift['RID']) . ")
AND `count` > 0
ORDER BY `room_id` DESC ORDER BY `room_id` DESC
"); ");
if ($needed_angeltypes_source === false) if ($needed_angeltypes_source === false)