調整心跳封包邏輯 20250701

svr 改到0
This commit is contained in:
allen.yan 2025-07-01 14:08:31 +08:00
parent da4ef0f0f3
commit 6e889e2e5f

View File

@ -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([