summaryrefslogtreecommitdiff
path: root/includes/model/Shifts_model.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-10-14 18:24:42 +0200
committermsquare <msquare@notrademark.de>2018-10-31 13:43:23 +0100
commitd7aea575ff77cd37c326511e7ac5fe49067c63ad (patch)
tree7a9699346ac737e6791b81562f82eae205829e36 /includes/model/Shifts_model.php
parent57932be4287d0ea6235137f1a86f07cbb06dd35b (diff)
Replaced more sql queries and old data
Diffstat (limited to 'includes/model/Shifts_model.php')
-rw-r--r--includes/model/Shifts_model.php30
1 files changed, 2 insertions, 28 deletions
diff --git a/includes/model/Shifts_model.php b/includes/model/Shifts_model.php
index 9e803efd..d7799a1e 100644
--- a/includes/model/Shifts_model.php
+++ b/includes/model/Shifts_model.php
@@ -235,11 +235,7 @@ function ShiftEntries_by_ShiftsFilter(ShiftsFilter $shiftsFilter)
{
$sql = '
SELECT
- `User`.`Nick`,
- `User`.`email`,
- `User`.`email_shiftinfo`,
- `User`.`Sprache`,
- `User`.`Gekommen`,
+ users.*
`ShiftEntry`.`UID`,
`ShiftEntry`.`TID`,
`ShiftEntry`.`SID`,
@@ -247,7 +243,7 @@ function ShiftEntries_by_ShiftsFilter(ShiftsFilter $shiftsFilter)
`ShiftEntry`.`freeloaded`
FROM `Shifts`
JOIN `ShiftEntry` ON `ShiftEntry`.`SID`=`Shifts`.`SID`
- JOIN `User` ON `ShiftEntry`.`UID`=`User`.`UID`
+ JOIN `users` ON `ShiftEntry`.`UID`=`users`.`id`
WHERE `Shifts`.`RID` IN (' . implode(',', $shiftsFilter->getRooms()) . ')
AND `start` BETWEEN ? AND ?
ORDER BY `Shifts`.`start`';
@@ -685,25 +681,3 @@ function Shift($shift_id)
return $result;
}
-
-/**
- * Returns all shifts with needed angeltypes and count of subscribed jobs.
- *
- * @return array
- */
-function Shifts()
-{
- $shifts_source = DB::select('
- SELECT `ShiftTypes`.`name`, `Shifts`.*, `Room`.`RID`, `Room`.`Name` AS `room_name`
- FROM `Shifts`
- JOIN `ShiftTypes` ON (`ShiftTypes`.`id` = `Shifts`.`shifttype_id`)
- JOIN `Room` ON `Room`.`RID` = `Shifts`.`RID`
- ');
-
- foreach ($shifts_source as &$shift) {
- $needed_angeltypes = NeededAngelTypes_by_shift($shift['SID']);
- $shift['angeltypes'] = $needed_angeltypes;
- }
-
- return $shifts_source;
-}