docs(quick): 完成尾首概率分析弹窗 quick task

This commit is contained in:
2026-05-02 15:36:48 +08:00
parent 919fbbc148
commit e07d472dd1
3 changed files with 43 additions and 0 deletions
+2
View File
@@ -85,6 +85,8 @@ None yet.
| 260424-roj | 在history页面新增特码冷热查询功能 | 2026-04-24 | 2513bbb | [260424-roj](./quick/260424-roj-history-y/) |
| 260425-w2i | 在控制台页面新增区域转移概率统计功能 | 2026-04-25 | 28415a1 | [260425-w2i](./quick/260425-w2i-5-10/) |
| 260502-ljh | 在history页面新增尾首概率分析弹窗 | 2026-05-02 | 919fbbc | [260502-ljh](./quick/260502-ljh-history/) |
## Deferred Items
| Category | Item | Status | Deferred At |
@@ -0,0 +1,20 @@
---
title: "在history页面新增一个弹窗,显示:下一期尾数与前一期尾数相同的概率、下一期首位与前一期首位相同的概率"
mode: quick
status: in-progress
tasks_count: 3
created: 2026-05-02
---
## Plan
### Task 1: 后端新增接口
- File: `application/admin/controller/History.php` — 新增 `tailHeadProbability` 方法
- File: `application/admin/model/History.php` — 新增 `getTailHeadProbability` 方法
- 逻辑:查询全部历史数据(按 openTime 升序),逐期对比相邻两期的尾数和首位,统计相同概率
### Task 2: 前端添加工具栏按钮
- File: `application/admin/view/history/index.html` — 在工具栏添加"尾首概率"按钮
### Task 3: 前端弹窗逻辑
- File: `public/assets/js/backend/history.js` — 新增按钮点击事件 + `showTailHeadProbabilityDialog` 方法
@@ -0,0 +1,21 @@
---
title: "在history页面新增一个弹窗,显示:下一期尾数与前一期尾数相同的概率、下一期首位与前一期首位相同的概率"
mode: quick
status: complete
date: 2026-05-02
---
## Summary
Completed quick task: Added a "尾首概率" (Tail-Head Probability) dialog to the history page.
### Changes
- `application/admin/model/History.php` — Added `getTailHeadProbability()` method that analyzes consecutive period transitions of the special code (num7), calculating the probability of tail (ones digit) and head (tens digit) remaining the same
- `application/admin/controller/History.php` — Added `tailHeadProb` endpoint + added to `$noNeedRight`
- `application/admin/view/history/index.html` — Added toolbar button with `btn-tailheadprob` class
- `public/assets/js/backend/history.js` — Added click handler + `showTailHeadProbabilityDialog()` with period selector (30/50/100/200)
### Implementation details
- Tail = num % 10 (个位), Head = floor(num / 10) (十位)
- Only counts valid transitions (both numbers in 1-49 range)
- Displays probability as percentage with period count and transition count