調整心跳封包邏輯 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,8 +156,12 @@ class RoomControlController extends Controller
if (preg_match('/^([A-Za-z]+)(\d+)$/', $validated['hostname'], $matches)) { if (preg_match('/^([A-Za-z]+)(\d+)$/', $validated['hostname'], $matches)) {
$roomType = strtolower($matches[1]); // 'PC' → 'pc' $roomType = strtolower($matches[1]); // 'PC' → 'pc'
$roomName = $matches[2]; // '101' $roomName = $matches[2]; // '101'
if($roomType =='svr'){
$floor = '0';
} else{
$floor = (int) substr($roomName, 0, 1); $floor = (int) substr($roomName, 0, 1);
} }
}
$branch=Branch::where('name',$validated['branch_name'])->first(); $branch=Branch::where('name',$validated['branch_name'])->first();
$room = Room::firstOrNew([ $room = Room::firstOrNew([
'branch_id' => $branch->id, 'branch_id' => $branch->id,