Commit Graph

209 Commits (c03737308b0e4468047cf3ed1ffeffb45c95cfe6)

Author SHA1 Message Date
Council c03737308b fix(Admin): 改用 random_int() CSPRNG,修正 UUID v4 版本/变体位
mt_rand() → random_int()(防种子预测)
版本号 nibble: 8 → 4(符合 RFC 4122 UUID v4)
变体位保持 10xx 格式不变
2026-04-20 13:21:44 +08:00
Council 1244adfaae feat(Admin): SeatTemplateSave 时为无 id 的 room 生成 UUID
兜底逻辑:在保存场馆模板时,遍历 rooms,
若 room.id 为空则用 time()+mt_rand 生成唯一 UUID。
不修改已有数据的读取逻辑(读取端已有 room_N 兼容兜底)。
2026-04-20 12:58:19 +08:00
Council 8a33e7fa29 fix(AdminGoodsSaveHandle): 空id房间用数组索引匹配 room_0/room_1
DB 中模板5的room[0].id为空,selected_rooms发来room_0。
filter无法匹配空id导致selectedRoomIds=[],rooms为空。

修复:空id时用数组索引作为room_N(N从0开始)进行匹配。
PHP 7.x兼容,无str_starts_with。
2026-04-20 12:42:46 +08:00
Council 5dc9a98420 fix: Db::find() 全量查询 + fallback 到 params[data];同时加调试日志 2026-04-20 12:25:02 +08:00
Council 0a2fd29d7c debug: add temp logging to trace template_snapshot rebuild 2026-04-20 12:23:58 +08:00
Council da001797ab fix(vr_ticket): template_snapshot 重建逻辑重写 + 幽灵配置过滤
=== 问题 1: template_snapshot.rooms 为空 ===

根因:前端 outputBase64 根本不包含 template_snapshot,导致:
- template_snapshot 永远是空的
- 无论 v1/v3 格式,rooms 信息都丢失

修复(AdminGoodsSaveHandle.php):
- 条件从「template_snapshot 为空才读 DB」改为「selected_rooms 有值就永远从 DB 重建」
- 读 DB 时同时做 v1→v3 迁移(sections+map → rooms 数组)
- ID 匹配支持前端标准化的 "room_0" 格式和 DB 原始 "0" 格式双向兼容
- PHP 7.x 兼容(strpos 而非 str_starts_with)

=== 问题 2: 幽灵配置(软删除场馆仍出现在表单)===

根因:AdminGoodsSave.php 查询模板时用 where('status', 1),软删除模板不加载,
但 configs.value 里还保留着旧配置 → 场馆 checkbox 选中但无法操作。

修复(AdminGoodsSave.php):
- 加载时用 Set 过滤掉 status=0 模板的配置
- 幽灵配置在编辑表单加载时直接排除,不出现在 UI
2026-04-20 12:16:31 +08:00
Council ca7bee5494 fix(AdminGoodsSaveHandle): save_thing_end 改为直接读 DB 而非 值拷贝
确保 template_snapshot 兜底逻辑在正确的数据上执行:
1. ShopXO save_thing_end 传入的 $data 是值拷贝,改用 Db::find() 直接从DB读
2. 加 json_last_error() 检查,防止损坏的 JSON 静默失败
2026-04-20 11:28:34 +08:00
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 effe522ebf Merge branch 'council/BackendArchitect'
# Conflicts:
#	plan.md
2026-04-20 10:00:59 +08:00
Council 20830abbc0 docs(plan): 记录 P1+P2 修复已合并到 main
Commit: 804d465d0 → main: 49930844f

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 10:00:05 +08:00
Council 49930844fa Merge branch 'council/BackendArchitect' 2026-04-20 09:59:41 +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 7ddfed55c1 council(review): SecurityEngineer - merge Task 13 audit report into main plan
Task 13 complete: reviews/SecurityEngineer-AUDIT.md
- Confirms BackendArchitect root cause findings (P0: Line 77, P1: Line 71)
- Adds PHP 8 compatibility note on null[key] TypeError
- Provides complete fix code

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 09:57:43 +08:00
Council 41c8fda398 council(review): BackendArchitect - add Task 12, all reviews complete
All tasks done:
- Tasks 1-8: BackendArchitect root cause analysis
- Tasks 9-11: DebugAgent static analysis + ROOT_CAUSE report
- Task 12: BackendArchitect cross-review of DebugAgent report

Issue #13 root cause fully documented and cross-verified.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 09:57:01 +08:00
Council 7a14acf6bc council(review): SecurityEngineer - Round 2 安全审计完成:根因定位 + 修复建议
根因:AdminGoodsSaveHandle.php:77 - \$r['id'] 无空安全
Secondary:Line 71 - find() 返回 null 后直接访问 \$template['seat_map']
报告:reviews/SecurityEngineer-AUDIT.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 09:56:52 +08:00
Council 6c35ac5c0f Merge branch 'council/BackendArchitect' 2026-04-20 09:56:20 +08:00
Council 8211419400 council(review): BackendArchitect - approve DebugAgent ROOT_CAUSE report
- Confirms Primary/Secondary/Tertiary root causes
- Notes array_column(null) PHP 8.0+ warning finding
- No conflicts with BackendArchitect findings

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 09:56:16 +08:00
Council 4b48e4648e council(review): DebugAgent - Task 10-11 complete, ROOT_CAUSE report
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 09:54:31 +08:00
Council 30a7663b16 council(review): DebugAgent - Task 10-11 complete, ROOT_CAUSE report
- 验证 ShopXO prefix = 'vrt_', 两者等价(已排除)
- 确认 P1=77行$riid, P2=71行template null, P3=类型不匹配
- 输出 reports/DebugAgent-ROOT_CAUSE.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 09:53:20 +08:00
Council 56b291f2f8 council(draft): DebugAgent - resolve plan.md conflict, sync with main
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 09:51:57 +08:00
Council 9d111541af council(draft): DebugAgent - Round 1 静态分析 + 补充 plan.md + Task 9-11
- 补充 PHP 8+ ?? 行为分析
- 新增 reviews/DebugAgent-PRELIMINARY.md
- plan.md 新增 Task 9-11(DebugAgent Round 2)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 09:51:04 +08:00
Council 3799b2bc92 council(review): BackendArchitect - Issue #13 根因已定位:AdminGoodsSaveHandle.php:77
- Primary: $r['id'] 无空安全(array_filter 回调内)→ "Undefined array key 'id'"
- Secondary: find() 返回 null 后直接访问 $template['seat_map']
- Tertiary: selected_rooms 类型不匹配静默失败
- 已排除:表前缀问题(Db::name 和 BaseService::table 均查询 vrt_vr_seat_templates)
- 已排除:SeatSkuService::BatchGenerate 有正确的空安全处理

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 09:48:53 +08:00
Council 04766c2424 council(draft): BackendArchitect - create debug plan for "Undefined array key 'id'" error
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 09:46:29 +08:00
Council 0385f79106 council(draft): DebugAgent - plan.md: debug "Undefined array key id" error
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 09:46:20 +08:00
Council 98bd6a52cf docs: 补充 template_snapshot 前端vs后端职责说明 + 更新 Issue #13 进度 2026-04-20 09:43:29 +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 7f32ad87c2 docs: README 重构 + VR_GOODS_CONFIG_SPEC.md 加目录 + 追加开发日志第十三章
- README: 新增清晰文档索引(必读/实现参考/调研存档/历史存档四分类)
- VR_GOODS_CONFIG_SPEC.md: 加 Markdown TOC
- DEVELOPMENT_LOG.md: 追加第十三章(模板渲染修复 + v3.0 格式确认)
2026-04-20 09:25:01 +08:00
Council 741f25451c docs: v3.0 最终规格 - template_snapshot 字段 + selected_sections 对象格式
核心变更:
- 新增 template_snapshot 字段(发布时从 vr_seat_templates 读取并存储)
- selected_sections 确认为对象格式 { room_id: ["A","B"] }
- spec_base_id_map 使用 goods_spec_base.extends 动态构建
- 现有前端编辑体验完全不受影响
- Issue #13 已同步更新
2026-04-20 09:04:23 +08:00
Council 6daa332323 docs: v3.0 vr_goods_config spec + Phase2 plan v3.0
v3.0 核心变更:
- selected_sections 改为数组格式 [A,B]
- spec_base_id_map 使用 goods_spec_base.extends 动态构建
- seat_key 格式: roomId_rowLabel_colNum(无 MD5)
- 完整规格文档: docs/VR_GOODS_CONFIG_SPEC.md
2026-04-20 08:30:00 +08:00
Council 977cc57aef docs: new vr_goods_config spec + Phase 2 v2.0 plan 2026-04-20 07:24:57 +08:00
Council 1b0ac3276d fix: 替换为票务专用精简 footer
移除 ShopXO 默认导航(关于我们/招聘/客户服务等)
保留:返回首页 + 版权 + ICP备案
2026-04-20 06:35:24 +08:00
Council c894e70188 fix: 复制 ShopXO public 模板 + 修复 footer_page 不存在问题
- 将 ShopXO 默认主题 public/ 目录完整复制到插件 goods/public/
- ticket_detail.html 中 footer_page → footer(footer_page.html 不存在于 ShopXO)
- ModuleInclude() 现在可以正确解析:view_path(goods/) + public/header.html 
2026-04-20 06:29:37 +08:00
Council 349ec063c1 fix: 替换 ThinkTemplate 标签为 PHP ModuleInclude
路线 B:票务模板不依赖 ThinkTemplate 解析引擎
- {include file=...} → <?php echo ModuleInclude(...) ?>
- {:Config()} / {:IsMobileLogin()} → <?php echo Config() ?> / <?php echo IsMobileLogin() ?>
- {$var|default=...} → <?php echo $var ?? 'default' ?>
- {$var|json_encode|raw} → <?php echo json_encode($var ?? []) ?>

绕过 ThinkTemplate parseTemplateFile() 路径拼接 bug(Linux view_depr=/ 导致 include 路径解析错误)
2026-04-20 06:23:29 +08:00
Council bf71aa1098 docs: add Council evaluation report (Architect + BackendArchitect)
综合评审:
- docs/14: 表名前缀不一致(vr_seat_templates vs vrt_vr_seat_templates)
- DEVELOPMENT_LOG: Git 状态落后一个提交
- PHASE2_PLAN: 核销 API 安全上下文缺失
Top 3 问题已定位,行动清单已列出
2026-04-20 05:30:23 +08:00
Council 496271c468 council(review): Architect - 完成三份文档评审,输出 Top 3 修正建议
Top 3 问题:
1. `{include}` 标签验证状态未闭环(已提交 ≠ 已验证)
2. DEVELOPMENT_LOG 两条 Git 时间线未衔接
3. 测试数据 goods_id 在多份文档中出现三个不同值

详见 reviews/Architect-DOC-SUMMARY.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 05:29:36 +08:00
Council ce20d2b430 council(review): BackendArchitect - 完成三份文档评审
- reviews/BackendArchitect-on-14_TEMPLATE_RENDER_INVESTIGATION.md
- reviews/BackendArchitect-on-PHASE2_PLAN.md
- reviews/BackendArchitect-on-DEVELOPMENT_LOG.md
- reviews/BackendArchitect-DOCUMENTATION_REVIEW_SUMMARY.md

Top 3 问题:
1. vr_seat_templates 表名前缀不一致(docs/14)
2. docs/14 缺少 Phase 1/Phase 2 改法关系说明
3. DEVELOPMENT_LOG.md 11.3 Git 快照已过时

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 05:28:58 +08:00
Council e8554f29ad council(draft): Architect - 文档评估计划(Round 1)
评审三份文档:
- docs/14_TEMPLATE_RENDER_INVESTIGATION.md
- docs/PHASE2_PLAN.md
- docs/DEVELOPMENT_LOG.md(第十一、十二章)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 05:25:54 +08:00
Council 3775f42789 council(draft): BackendArchitect - add documentation review plan
- Add BackendArchitect Round 1 section to plan.md
- Claim 4 review tasks: 3 docs + 1 summary
- Dimensions: accuracy, completeness, actionability, consistency, misleading risk

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 05:25:48 +08:00
Council 914e2a0fc3 docs: 修正 docs/14 + 新增 PHASE2_PLAN.md
- docs/14: 修正数据流/表名/Think驱动等3处错误,删除过时状态
- PHASE2_PLAN.md: Phase 2 当前状态 + 模板渲染待验证项 + 下一步计划
- DEVELOPMENT_LOG.md: 追加 Phase 2 完成记录
2026-04-20 05:24:26 +08:00
Council 7bd8967648 feat(Phase 2): 完成票务商品前端展示层
- Goods.php: item_type=ticket 时加载 ticket_detail.html 模板
- SeatSkuService.php: 新增 GetGoodsViewData() 供前端模板使用
- TicketService.php: onOrderPaid 改用 sxo_order_detail 表 + JSON spec 解析

关联: Phase 2 前台展示层完成
2026-04-20 05:22:07 +08:00
Council dc63cff77c chore: clean up my_test_plugin residual hooks from event.php
删除 event.php 中的 my_test_plugin 残留引用(插件已删除)。
保留 vr_ticket 所有钩子映射不变。
2026-04-19 15:56:48 +08:00
Council bbb2e65330 fix: 修复 vr_ticket 插件文件被 gitignore 忽略的问题
- 强制追踪 vr_ticket/Event.php(被 shopxo/app/.gitignore 的 event.php 规则遮蔽)
- 强制追踪 vr_ticket/database/migrations/*.sql(被全局 gitignore 的 database 规则遮蔽)
- 删除 shopxo/app/.gitignore(规则过宽,影响插件文件)
- 追踪 shopxo/app/event.php(ShopXO 源码,被上条 .gitignore 遮蔽)
- 更新项目 .gitignore(vendor/upload/adminufgeyw/强制追踪database)
2026-04-19 15:54:03 +08:00
Council f3f12e3ea5 chore: exclude adminufgeyw.php (ShopXO install-specific, restored from council-research) 2026-04-19 15:45:38 +08:00
Council dfee295709 chore: update .gitignore (add vendor/upload/data.db), drop outdated comment 2026-04-19 15:38:40 +08:00
Council b9da3e6fb7 docs: add category_id empty bug analysis report (P0) 2026-04-19 07:38:27 +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
Council 111063d785 docs: add 13_GOODS_ADD_HOOK_RESEARCH.md - goods add hook survey
- Code-verified: vr_seat_templates full field list + seat_map v3 JSON structure
- Confirmed: no goods_save hook exists yet, no vr_goods_config table
- Critical bug found: SeatSkuService.php has corrupted \t\think\xacade strings (P0 fix)
- Two-hook design: plugins_view_admin_goods_save + plugins_service_goods_save_handle
- goods.vr_goods_config JSON field (no new table needed)
- BatchGenerate extension: room/section filtering
2026-04-17 21:49:21 +08:00
Council 207f49839b docs: add 12_UNIAPP_FRONTEND_RESEARCH.md - shopxo-uniapp frontend architecture survey
- ShopXO DIY designer limitations (cannot import custom Vue components)
- shopxo-diy vs shopxo-uniapp architecture relationship
- Recommended path: fork shopxo-uniapp, modify Vue source directly
- H5/mini-program CSS consistency via rpx + uni-app WebView
- Full evidence archive and pending deep-dive items for 美在
2026-04-17 13:54:13 +08:00
Council 2452fde466 refactor(vr_ticket): full plugin restructure - Admin.php root pattern + Hook.php
Phase 2 completion - complete backend management rebuild:

Plugin architecture change (旧 → 新):
- 删: admin/controller/ 子目录多控制器 → 留: admin/Admin.php 单控制器
- 删: admin/view/ → 留: view/{module}/
- 删: EventListener.php, app.php, plugin.json → 留: Hook.php, config.json

New files:
- Hook.php: 插件钩子入口(侧边栏菜单 + 订单支付处理)
- config.json: 插件配置(is_enable 等)
- install.sql / uninstall.sql: 安装卸载脚本
- view/venue/list.html, save.html: 场馆管理视图(AmazeUI)
- view/admin/setup.html: 插件设置页

Modified files:
- service/AuditService.php, BaseService.php, SeatSkuService.php, TicketService.php
- admin/Admin.php: 全新 Admin.php 根目录控制器

ShopXO core changes:
- app/index/controller/Goods.php: ticket 类型商品详情页路由
- app/service/AdminPowerService.php: 权限系统适配
- config/shopxo.php: 配置

AmazeUI frontend migration:
- All views migrated from LayUI to AmazeUI
- Vue 3 editor for venue/seat configuration
- CDN: unpkg.com → cdn.staticfile.net

Fixes included:
- Infinite loading (missing footer include)
- Vue3 textarea interpolation bug
- Template path resolution (../../../plugins/...)
- Hook return fields (id/url/is_show)
- DB field names verified from source
2026-04-17 00:46:00 +08:00
Council e7730170f3 docs: add EXPERIENCES.md - 16 critical lessons from refactoring session
- docs/EXPERIENCES.md: Cleaned experience document with P0/P1/P2 classification
  - P0: footer missing → infinite loading, Vue3 textarea interpolation, field names from source
  - P1: plugin view paths, Hook.php return fields, CDN blocking, PHP comment pollution
  - P2: AmazeUI classes, Base64 URL encoding, search field consistency
- README.md: Add prominent link in top section + update project status
- docs/refactoring_learnings.md: Granular 24-round extraction from raw log
2026-04-17 00:43:34 +08:00