From e07d472dd1659a1f66a5b2f741a4ab69f87bb318 Mon Sep 17 00:00:00 2001 From: leon <916117771@qq.com> Date: Sat, 2 May 2026 15:36:48 +0800 Subject: [PATCH] =?UTF-8?q?docs(quick):=20=E5=AE=8C=E6=88=90=E5=B0=BE?= =?UTF-8?q?=E9=A6=96=E6=A6=82=E7=8E=87=E5=88=86=E6=9E=90=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=20quick=20task?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .planning/STATE.md | 2 ++ .../260502-ljh-history/260502-ljh-PLAN.md | 20 ++++++++++++++++++ .../260502-ljh-history/260502-ljh-SUMMARY.md | 21 +++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 .planning/quick/260502-ljh-history/260502-ljh-PLAN.md create mode 100644 .planning/quick/260502-ljh-history/260502-ljh-SUMMARY.md diff --git a/.planning/STATE.md b/.planning/STATE.md index 582b56b..067d8c9 100644 --- a/.planning/STATE.md +++ b/.planning/STATE.md @@ -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 | diff --git a/.planning/quick/260502-ljh-history/260502-ljh-PLAN.md b/.planning/quick/260502-ljh-history/260502-ljh-PLAN.md new file mode 100644 index 0000000..34d00c2 --- /dev/null +++ b/.planning/quick/260502-ljh-history/260502-ljh-PLAN.md @@ -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` 方法 diff --git a/.planning/quick/260502-ljh-history/260502-ljh-SUMMARY.md b/.planning/quick/260502-ljh-history/260502-ljh-SUMMARY.md new file mode 100644 index 0000000..c71b1cc --- /dev/null +++ b/.planning/quick/260502-ljh-history/260502-ljh-SUMMARY.md @@ -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