Merge branch 'council/BackendArchitect'

council/ProductManager
Council 2026-04-20 09:59:41 +08:00
commit 49930844fa
1 changed files with 4 additions and 1 deletions

View File

@ -68,13 +68,16 @@ class AdminGoodsSaveHandle
$templateId = intval($config['template_id'] ?? 0); $templateId = intval($config['template_id'] ?? 0);
if ($templateId > 0) { if ($templateId > 0) {
$template = Db::name('vr_seat_templates')->find($templateId); $template = Db::name('vr_seat_templates')->find($templateId);
if (empty($template)) {
continue;
}
$seatMap = json_decode($template['seat_map'] ?? '{}', true); $seatMap = json_decode($template['seat_map'] ?? '{}', true);
$allRooms = $seatMap['rooms'] ?? []; $allRooms = $seatMap['rooms'] ?? [];
// 按 selected_rooms 过滤,只存用户选中的房间 // 按 selected_rooms 过滤,只存用户选中的房间
$selectedRoomIds = array_column( $selectedRoomIds = array_column(
array_filter($allRooms, function ($r) use ($config) { array_filter($allRooms, function ($r) use ($config) {
return in_array($r['id'], $config['selected_rooms'] ?? []); return isset($r['id']) && in_array($r['id'], $config['selected_rooms'] ?? []);
}), null }), null
); );