調整Array 用 roomName 當 key
This commit is contained in:
parent
f7f8dad5b4
commit
69e12a08bf
@ -58,13 +58,15 @@ class BranchControlController extends Controller
|
||||
'enable' => $branch->enable,
|
||||
'rooms' => $branch->rooms
|
||||
->filter(fn($room) => $room->type === RoomType::PC)
|
||||
->map(function ($room) {
|
||||
->mapWithKeys(function ($room) {
|
||||
$roomName = $room->type->value . $room->name;
|
||||
return [
|
||||
'room_name' => $room->type->value.$room->name,
|
||||
'is_online' => $room->is_online,
|
||||
'status' => $room->status->value,
|
||||
'started_at' => $room->started_at,
|
||||
'ended_at' => $room->ended_at,
|
||||
$roomName => [
|
||||
'is_online' => $room->is_online,
|
||||
'status' => $room->status->value,
|
||||
'started_at' => $room->started_at,
|
||||
'ended_at' => $room->ended_at,
|
||||
]
|
||||
];
|
||||
}),
|
||||
];
|
||||
|
Loading…
x
Reference in New Issue
Block a user