From af15aef37de98761eaa13552563c4e86978ea15f Mon Sep 17 00:00:00 2001 From: leon <916117771@qq.com> Date: Sat, 25 Apr 2026 23:28:39 +0800 Subject: [PATCH] =?UTF-8?q?fix(dashboard):=20=E5=8C=BA=E5=9F=9F=E8=BD=AC?= =?UTF-8?q?=E7=A7=BB=E6=A6=82=E7=8E=87=E7=A7=BB=E8=87=B3=E7=83=AD=E5=8A=9B?= =?UTF-8?q?=E5=9B=BE=E4=B8=8A=E6=96=B9=EF=BC=9B=E4=BF=AE=E6=AD=A3=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E9=A1=BA=E5=BA=8F=E4=B8=BA=E6=9C=80=E8=BF=91=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/model/History.php | 5 ++++- public/assets/js/backend/dashboard.js | 10 +++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/application/admin/model/History.php b/application/admin/model/History.php index 15b5b55..9cf6a47 100644 --- a/application/admin/model/History.php +++ b/application/admin/model/History.php @@ -674,7 +674,7 @@ class History extends Model { $history = $this ->field('expect,num7,openTime') - ->order('openTime', 'asc') + ->order('openTime', 'desc') ->limit($periods) ->select(); @@ -682,6 +682,9 @@ class History extends Model return ['zones' => ['1-10','11-20','21-30','31-40','41-49'], 'matrix' => [], 'probabilities' => [], 'total_transitions' => 0]; } + // 反转为升序,从旧到新 + $history = array_reverse($history); + $zoneLabels = ['1-10', '11-20', '21-30', '31-40', '41-49']; $matrix = array_fill(0, 5, array_fill(0, 5, 0)); $rowTotals = array_fill(0, 5, 0); diff --git a/public/assets/js/backend/dashboard.js b/public/assets/js/backend/dashboard.js index f0121cf..64607a5 100644 --- a/public/assets/js/backend/dashboard.js +++ b/public/assets/js/backend/dashboard.js @@ -85,14 +85,10 @@ define(['jquery'], function ($) { html += '

🔢 尾数频率

'; - // 热力图部分 - var hm = data.heatmap; - html += '

🎨 特码热力图

X轴:期号(从左往右,从远到近) | Y轴:号码1-49 | 颜色:号码波色
'; - // 区域转移概率 if (zt && zt.matrix && zt.matrix.length > 0) { html += '

🔄 区域转移概率

当前共 ' + zt.total_transitions + ' 次区域转移 | 行=上一期特码所在区域,列=下一期特码所在区域
'; - html += ''; + html += '
区域特码
'; for (var z = 0; z < zt.zones.length; z++) { html += ''; } @@ -111,6 +107,10 @@ define(['jquery'], function ($) { html += '
区域特码
' + zt.zones[z] + '
'; } + // 热力图部分 + var hm = data.heatmap; + html += '

🎨 特码热力图

X轴:期号(从左往右,从远到近) | Y轴:号码1-49 | 颜色:号码波色
'; + $('#dash-content').html(html); // 波色饼图