From d7aea575ff77cd37c326511e7ac5fe49067c63ad Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Sun, 14 Oct 2018 18:24:42 +0200 Subject: Replaced more sql queries and old data --- includes/model/Shifts_model.php | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) (limited to 'includes/model/Shifts_model.php') 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; -} -- cgit v1.2.3-70-g09d2