調整 分店資訊 只 PC的資訊
This commit is contained in:
parent
c9aef372ef
commit
f7f8dad5b4
@ -6,6 +6,8 @@ use Illuminate\Http\Request;
|
|||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use App\Models\Branch;
|
use App\Models\Branch;
|
||||||
|
use App\Enums\RoomType;
|
||||||
|
use App\Enums\RoomStatus;
|
||||||
use App\Http\Responses\ApiResponse;
|
use App\Http\Responses\ApiResponse;
|
||||||
/**
|
/**
|
||||||
* @OA\Tag(
|
* @OA\Tag(
|
||||||
@ -54,11 +56,13 @@ class BranchControlController extends Controller
|
|||||||
'id' => $branch->id,
|
'id' => $branch->id,
|
||||||
'branch_name' => $branch->name,
|
'branch_name' => $branch->name,
|
||||||
'enable' => $branch->enable,
|
'enable' => $branch->enable,
|
||||||
'rooms' => $branch->rooms->map(function ($room) {
|
'rooms' => $branch->rooms
|
||||||
|
->filter(fn($room) => $room->type === RoomType::PC)
|
||||||
|
->map(function ($room) {
|
||||||
return [
|
return [
|
||||||
'room_name' => $room->type.$room->name,
|
'room_name' => $room->type->value.$room->name,
|
||||||
'is_online' => $room->is_online,
|
'is_online' => $room->is_online,
|
||||||
'status' => $room->status,
|
'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