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