vr-shopxo-plugin/shopxo/app/plugins/vr_ticket
Council 35c10a7f66 council(security): SecurityEngineer - add missing VenueList methods + security audit
Security findings:
- SQL injection: LOW (query builder + parameter binding)
- XSS: LOW (ThinkPHP auto-escape, no |raw detected)
- Path traversal: LOW (all view paths hardcoded)
- CSRF: MEDIUM (ShopXO framework-level gap, out of scope for plugin)

Critical fix: admin/Admin.php was missing VenueList(), VenueSave(),
VenueDelete() — sidebar URL "/plugins/vr_ticket/admin/venueList" would
return 500 error. Added all three methods with v3.0 seat_map support.

P1 garbled name: documented DB fix SQL for shx_plugins + vrt_power tables.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-16 08:53:41 +08:00
..
admin council(security): SecurityEngineer - add missing VenueList methods + security audit 2026-04-16 08:53:41 +08:00
service feat(Phase 3-1): Venue.php CRUD + list.html + BatchGenerate venue.name 动态读取 2026-04-15 22:02:03 +08:00
view/goods
EventListener.php
README.md
app.php fix(Phase 2): 修复后台路由+视图路径,Vrticket控制器上线 2026-04-16 07:59:27 +08:00
plugin.json council(round3): FrontendDev - fix admin/Admin.php routing + camelCase sidebar URLs 2026-04-16 08:34:50 +08:00

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 核销记录