Commit Graph

4 Commits (3f06f36e5056473919e85ab976b846fe28d2112d)

Author SHA1 Message Date
Council 3f06f36e50 fix(AdminGoodsSaveHandle): template_snapshot rooms为空时DB兜底 + v1→v3迁移
修复 Issue #13:
1. 条件从 empty(template_snapshot) 改为 empty(rooms),解决前端发送空rooms对象时跳过兜底的问题
2. 新增 v1 旧格式兼容:sections+map 扁平结构自动升級为 v3 rooms 数组
2026-04-20 10:40:26 +08:00
Council 804d465d09 fix(AdminGoodsSaveHandle): P1+P2 空安全修复 — 解决 "Undefined array key 'id'" 错误
P1 (line 80): array_filter 回调内 $r['id'] 前加 isset() 空安全
P2 (line 71-73): find() 返回 null 时 continue 跳过,避免访问 $template['seat_map']

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 09:59:31 +08:00
Council bbea35d837 feat(AdminGoodsSaveHandle): 保存时自动填充 template_snapshot
Issue #13 Step 1:
- save_thing_end 时机:遍历 vr_goods_config[],检测 template_snapshot 是否缺失
- 若缺失:从 vr_seat_templates 读最新 seat_map,按 selected_rooms 过滤 rooms
- 将填充后的完整 config JSON 写回 goods 表,再执行 BatchGenerate
- 前端已传 template_snapshot 时:直接透传,无需后端处理
2026-04-20 09:36:06 +08:00
Council 9603ab42f6 refactor(vr_ticket): Admin.php root pattern → Hook-based goods save
- DELETE old Admin.php root controller (Vrticket.php)
- DELETE old Layui view files (seat_template/ticket/venue/verification/verifier)
- ADD hook/AdminGoodsSave.php: plugins_view_admin_goods_save hook (Vue3 form injection)
- ADD hook/AdminGoodsSaveHandle.php: handle save flow (save_handle + save_thing_end)
- UPDATE config.json: register 3 new hooks
- UPDATE SeatSkuService.php: refactored BatchGenerate
- ADD data.db: SQLite venue data
- UPDATE venue/save.html: venue editing form
- docs: add GOODS_ADD_HOOK_RESEARCH.md + update plan.md
2026-04-19 05:46:37 +08:00