Merge branch 'council/BackendArchitect'
commit
49930844fa
|
|
@ -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
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue