diff options
Diffstat (limited to 'includes/model')
-rw-r--r-- | includes/model/NeededAngelTypes_model.php | 5 | ||||
-rw-r--r-- | includes/model/ShiftEntry_model.php | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/includes/model/NeededAngelTypes_model.php b/includes/model/NeededAngelTypes_model.php index e04ef8b8..76796869 100644 --- a/includes/model/NeededAngelTypes_model.php +++ b/includes/model/NeededAngelTypes_model.php @@ -84,13 +84,12 @@ function NeededAngelTypes_by_shift($shiftId) { } } + $shift_entries = ShiftEntries_by_shift($shiftId); $needed_angeltypes = []; foreach ($needed_angeltypes_source as $angeltype) { - $shift_entries = ShiftEntries_by_shift_and_angeltype($shiftId, $angeltype['angel_type_id']); - $angeltype['taken'] = 0; foreach($shift_entries as $shift_entry) { - if($shift_entry['freeloaded'] == 0) { + if($shift_entry['TID']==$angeltype['id'] && $shift_entry['freeloaded'] == 0) { $angeltype['taken']++; } } diff --git a/includes/model/ShiftEntry_model.php b/includes/model/ShiftEntry_model.php index dca7e1c1..9f4faf9e 100644 --- a/includes/model/ShiftEntry_model.php +++ b/includes/model/ShiftEntry_model.php @@ -28,7 +28,7 @@ function ShiftEntries_freeleaded_count() { */ function ShiftEntries_by_shift($shift_id) { return sql_select(" - SELECT `User`.`Nick`, `User`.`email`, `User`.`email_shiftinfo`, `User`.`Sprache`, `ShiftEntry`.`UID`, `ShiftEntry`.`TID`, `ShiftEntry`.`SID`, `AngelTypes`.`name` as `angel_type_name`, `ShiftEntry`.`Comment`, `ShiftEntry`.`freeloaded` + SELECT `User`.`Nick`, `User`.`email`, `User`.`email_shiftinfo`, `User`.`Sprache`, `User`.`Gekommen`, `ShiftEntry`.`UID`, `ShiftEntry`.`TID`, `ShiftEntry`.`SID`, `AngelTypes`.`name` as `angel_type_name`, `ShiftEntry`.`Comment`, `ShiftEntry`.`freeloaded` FROM `ShiftEntry` JOIN `User` ON `ShiftEntry`.`UID`=`User`.`UID` JOIN `AngelTypes` ON `ShiftEntry`.`TID`=`AngelTypes`.`id` |