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)
main
cbluoss 5 years ago committed by Igor Scheller
parent d70d7c6436
commit 74b464aab5

@ -636,8 +636,9 @@ function Shift($shift_id)
}
$shiftsEntry_source = DB::select('
SELECT `id`, `TID` , `UID` , `freeloaded`
SELECT `ShiftEntry`.`id`, `ShiftEntry`.`TID` , `ShiftEntry`.`UID` , `ShiftEntry`.`freeloaded`, `users`.`name` AS `username`
FROM `ShiftEntry`
LEFT JOIN `users` ON (`users`.`id` = `ShiftEntry`.`UID`)
WHERE `SID`=?', [$shift_id]);
$result['ShiftEntry'] = $shiftsEntry_source;

Loading…
Cancel
Save