From 6e889e2e5fb3f12f68999e4c43ea6a242595fa26 Mon Sep 17 00:00:00 2001 From: "allen.yan" Date: Tue, 1 Jul 2025 14:08:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AA=BF=E6=95=B4=E5=BF=83=E8=B7=B3=E5=B0=81?= =?UTF-8?q?=E5=8C=85=E9=82=8F=E8=BC=AF=2020250701=20svr=20=E6=94=B9?= =?UTF-8?q?=E5=88=B00?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/RoomControlController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/RoomControlController.php b/app/Http/Controllers/RoomControlController.php index 7ef10a9..dcdba52 100644 --- a/app/Http/Controllers/RoomControlController.php +++ b/app/Http/Controllers/RoomControlController.php @@ -156,7 +156,11 @@ class RoomControlController extends Controller if (preg_match('/^([A-Za-z]+)(\d+)$/', $validated['hostname'], $matches)) { $roomType = strtolower($matches[1]); // 'PC' → 'pc' $roomName = $matches[2]; // '101' - $floor = (int) substr($roomName, 0, 1); + if($roomType =='svr'){ + $floor = '0'; + } else{ + $floor = (int) substr($roomName, 0, 1); + } } $branch=Branch::where('name',$validated['branch_name'])->first(); $room = Room::firstOrNew([