diff options
author | msquare <msquare@notrademark.de> | 2016-12-28 01:09:40 +0100 |
---|---|---|
committer | msquare <msquare@notrademark.de> | 2016-12-28 01:09:40 +0100 |
commit | 363cc8f6b534ed6353ffe8acb020ba6e1d3ccff4 (patch) | |
tree | af56a1fc4be754ed009f480ee711f1d791534f95 /includes/model | |
parent | 75945fdbbd0908c31921ce586308863ff467e5fe (diff) |
more performance using union
Diffstat (limited to 'includes/model')
-rw-r--r-- | includes/model/Shifts_model.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/includes/model/Shifts_model.php b/includes/model/Shifts_model.php index de39aa5b..c23e4c0a 100644 --- a/includes/model/Shifts_model.php +++ b/includes/model/Shifts_model.php @@ -70,7 +70,7 @@ function Shifts_by_ShiftsFilter(ShiftsFilter $shiftsFilter, $user) { } function NeededAngeltypes_by_ShiftsFilter(ShiftsFilter $shiftsFilter, $user) { - $SQL = "SELECT `NeededAngelTypes`.*, `AngelTypes`.`id`, `AngelTypes`.`name`, `AngelTypes`.`restricted`, `AngelTypes`.`no_self_signup` + $SQL = "SELECT `NeededAngelTypes`.*, `Shifts`.`SID`, `AngelTypes`.`id`, `AngelTypes`.`name`, `AngelTypes`.`restricted`, `AngelTypes`.`no_self_signup` FROM `Shifts` JOIN `NeededAngelTypes` ON `NeededAngelTypes`.`shift_id`=`Shifts`.`SID` JOIN `AngelTypes` ON `AngelTypes`.`id`= `NeededAngelTypes`.`angel_type_id` @@ -79,8 +79,8 @@ function NeededAngeltypes_by_ShiftsFilter(ShiftsFilter $shiftsFilter, $user) { AND `Shifts`.`PSID` IS NULL UNION - - SELECT `NeededAngelTypes`.*, `AngelTypes`.`id`, `AngelTypes`.`name`, `AngelTypes`.`restricted`, `AngelTypes`.`no_self_signup` + + SELECT `NeededAngelTypes`.*, `Shifts`.`SID`, `AngelTypes`.`id`, `AngelTypes`.`name`, `AngelTypes`.`restricted`, `AngelTypes`.`no_self_signup` FROM `Shifts` JOIN `NeededAngelTypes` ON `NeededAngelTypes`.`room_id`=`Shifts`.`RID` JOIN `AngelTypes` ON `AngelTypes`.`id`= `NeededAngelTypes`.`angel_type_id` @@ -95,7 +95,7 @@ function NeededAngeltypes_by_ShiftsFilter(ShiftsFilter $shiftsFilter, $user) { } function NeededAngeltype_by_Shift_and_Angeltype($shift, $angeltype) { - $result = sql_select("SELECT `NeededAngelTypes`.*, `AngelTypes`.`id`, `AngelTypes`.`name`, `AngelTypes`.`restricted`, `AngelTypes`.`no_self_signup` + $result = sql_select("SELECT `NeededAngelTypes`.*, `Shifts`.`SID`, `AngelTypes`.`id`, `AngelTypes`.`name`, `AngelTypes`.`restricted`, `AngelTypes`.`no_self_signup` FROM `Shifts` JOIN `NeededAngelTypes` ON `NeededAngelTypes`.`shift_id`=`Shifts`.`SID` JOIN `AngelTypes` ON `AngelTypes`.`id`= `NeededAngelTypes`.`angel_type_id` @@ -105,7 +105,7 @@ function NeededAngeltype_by_Shift_and_Angeltype($shift, $angeltype) { UNION - SELECT `NeededAngelTypes`.*, `AngelTypes`.`id`, `AngelTypes`.`name`, `AngelTypes`.`restricted`, `AngelTypes`.`no_self_signup` + SELECT `NeededAngelTypes`.*, `Shifts`.`SID`, `AngelTypes`.`id`, `AngelTypes`.`name`, `AngelTypes`.`restricted`, `AngelTypes`.`no_self_signup` FROM `Shifts` JOIN `NeededAngelTypes` ON `NeededAngelTypes`.`room_id`=`Shifts`.`RID` JOIN `AngelTypes` ON `AngelTypes`.`id`= `NeededAngelTypes`.`angel_type_id` |