ShiftEntry query now returns the related user.name as well.
This was done for API requests to save additional queries, but should allow us to remove some queries pretty much everywhere shifts get listed (will be done in a new PR eventually)
This commit is contained in:
parent
d70d7c6436
commit
74b464aab5
|
@ -636,8 +636,9 @@ function Shift($shift_id)
|
||||||
}
|
}
|
||||||
|
|
||||||
$shiftsEntry_source = DB::select('
|
$shiftsEntry_source = DB::select('
|
||||||
SELECT `id`, `TID` , `UID` , `freeloaded`
|
SELECT `ShiftEntry`.`id`, `ShiftEntry`.`TID` , `ShiftEntry`.`UID` , `ShiftEntry`.`freeloaded`, `users`.`name` AS `username`
|
||||||
FROM `ShiftEntry`
|
FROM `ShiftEntry`
|
||||||
|
LEFT JOIN `users` ON (`users`.`id` = `ShiftEntry`.`UID`)
|
||||||
WHERE `SID`=?', [$shift_id]);
|
WHERE `SID`=?', [$shift_id]);
|
||||||
|
|
||||||
$result['ShiftEntry'] = $shiftsEntry_source;
|
$result['ShiftEntry'] = $shiftsEntry_source;
|
||||||
|
|
Loading…
Reference in New Issue