vr-shopxo-plugin/shopxo/app/plugins/vr_ticket
Council 2a6d7bdbf7 council(execute): FrontendDev - Round 4: export button fix + mark Phase 2 complete
- Fix P1 bug: ticket/list.html export button (GET→POST form) matching IS_AJAX_POST
- Mark all plan.md tasks complete (seat templates, tickets, verifiers, verifications views)
- BackendArchitect: AuditService.php (S4 design), Verifier.php CONCAT fix, Verification.php column() fix
- BackendArchitect: SeatTemplate.php countSeats fix, TicketService.php transaction fix
- BackendArchitect: EventListener.php audit_log table added
- SecurityEngineer: S1-S5 security audit complete
- [CONSENSUS: YES] all three agents vote YES

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 14:20:03 +08:00
..
admin council(execute): FrontendDev - Round 4: export button fix + mark Phase 2 complete 2026-04-15 14:20:03 +08:00
service council(execute): FrontendDev - Round 4: export button fix + mark Phase 2 complete 2026-04-15 14:20:03 +08:00
view/goods
EventListener.php council(execute): FrontendDev - Round 4: export button fix + mark Phase 2 complete 2026-04-15 14:20:03 +08:00
README.md
plugin.json

README.md

VR票务插件 - vr_ticket

核心原则:怎么快怎么来,怎么方便怎么来

安装

  1. 将本目录上传到 ShopXO 插件目录:
    cp -r vr_ticket /path/to/shopxo/app/plugins/
    
  2. 后台 → 应用中心 → 插件管理 → 找到「VR票务」→ 点击安装
  3. 数据库表自动创建

目录结构

vr_ticket/
├── plugin.json              # 插件配置(名称、菜单、钩子)
├── EventListener.php         # 安装/卸载/升级生命周期
├── service/
│   ├── BaseService.php       # 基础工具AES加密、QR生成
│   └── TicketService.php     # 核心票务逻辑(发票、核销)
├── admin/
│   ├── controller/
│   │   ├── SeatTemplate.php   # 座位模板 CRUD
│   │   ├── Ticket.php         # 电子票管理
│   │   ├── Verifier.php       # 核销员管理
│   │   └── Verification.php   # 核销记录
│   └── view/                  # 后台视图模板
│       ├── seat_template/
│       ├── ticket/
│       ├── verifier/
│       └── verification/
└── view/
    └── goods/
        └── ticket_detail.html  # 前端票务详情页(独立模板)

关键钩子

钩子 作用
plugins_service_order_pay_success_handle_end 支付成功 → 自动发放 QR 电子票
plugins_service_order_delete_success 订单删除 → 清理票务数据

前端票务详情页

需要在 ShopXO 核心文件 app/index/controller/Goods.php 中加 1 行:

// 在 return MyView(); 之前(约第 440 行)
if (!empty($assign['goods']['item_type']) && $assign['goods']['item_type'] == 'ticket') {
    return MyView('/../../../plugins/vr_ticket/view/goods/ticket_detail');
}

详见 docs/GOODS_PHP_MODIFICATION.md

数据库表

表名 用途
vrt_vr_seat_templates 座位模板(绑定分类)
vrt_vr_tickets 电子票(含观演人)
vrt_vr_verifiers 核销员
vrt_vr_verifications 核销记录

API

URL 方法 作用
/plugins/vr_ticket/admin/seat_template/list GET 座位模板列表
/plugins/vr_ticket/admin/seat_template/save GET/POST 添加/编辑模板
/plugins/vr_ticket/admin/ticket/list GET 电子票列表
/plugins/vr_ticket/admin/verification/list GET 核销记录