---
description: "在控制台页面新增区域转移概率统计：1-49分5区，统计特码所在区下一期特码出现在各区的概率"
status: in-progress
---
# Quick Task 260425-w2i: 区域转移概率统计

## Plan

1. **Model** — Add `getZoneTransition($periods)` method to `app\admin\model\History`
   - Query latest `$periods` periods ordered by openTime ASC
   - Divide numbers 1-49 into 5 zones: 1-10, 11-20, 21-30, 31-40, 41-49
   - For each consecutive pair of periods, record (current_zone → next_zone)
   - Return: `{zones: ['1-10','11-20','21-30','31-40','41-49'], matrix: [[count...]], probabilities: [[prob...]], total_transitions: N}`

2. **Controller** — Add `zoneTransition()` method to `app\admin\controller\History`
   - Accept `periods` param (default 100, range 10-500)
   - Add to `$noNeedRight` list
   - Call model method, return JSON response

3. **Dashboard** — Include `zoneTransition` in `getDashboardData()` response

4. **Frontend JS** — Add zone transition heatmap/table in `public/assets/js/backend/dashboard.js`
   - Render as a 5×5 matrix table with color-coded cells showing count and percentage
   - Append below existing heatmap section
