fix(dashboard): 区域转移概率移至热力图上方;修正查询顺序为最近数据

This commit is contained in:
2026-04-25 23:28:39 +08:00
parent 84f0d60817
commit af15aef37d
2 changed files with 9 additions and 6 deletions
+4 -1
View File
@@ -674,7 +674,7 @@ class History extends Model
{ {
$history = $this $history = $this
->field('expect,num7,openTime') ->field('expect,num7,openTime')
->order('openTime', 'asc') ->order('openTime', 'desc')
->limit($periods) ->limit($periods)
->select(); ->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]; 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']; $zoneLabels = ['1-10', '11-20', '21-30', '31-40', '41-49'];
$matrix = array_fill(0, 5, array_fill(0, 5, 0)); $matrix = array_fill(0, 5, array_fill(0, 5, 0));
$rowTotals = array_fill(0, 5, 0); $rowTotals = array_fill(0, 5, 0);
+5 -5
View File
@@ -85,14 +85,10 @@ define(['jquery'], function ($) {
html += '<div class="dash-section"><h4>🔢 尾数频率</h4><div id="tail-chart" style="width:100%;height:220px;"></div></div>'; html += '<div class="dash-section"><h4>🔢 尾数频率</h4><div id="tail-chart" style="width:100%;height:220px;"></div></div>';
// 热力图部分
var hm = data.heatmap;
html += '<div class="dash-section"><h4>🎨 特码热力图</h4><div style="font-size:12px;color:#999;margin-bottom:8px;">X轴:期号(从左往右,从远到近) | Y轴:号码1-49 | 颜色:号码波色</div><div id="heatmap-chart" style="width:100%;height:500px;"></div></div>';
// 区域转移概率 // 区域转移概率
if (zt && zt.matrix && zt.matrix.length > 0) { if (zt && zt.matrix && zt.matrix.length > 0) {
html += '<div class="dash-section"><h4>🔄 区域转移概率</h4><div style="font-size:12px;color:#999;margin-bottom:8px;">当前共 ' + zt.total_transitions + ' 次区域转移 | 行=上一期特码所在区域,列=下一期特码所在区域</div>'; html += '<div class="dash-section"><h4>🔄 区域转移概率</h4><div style="font-size:12px;color:#999;margin-bottom:8px;">当前共 ' + zt.total_transitions + ' 次区域转移 | 行=上一期特码所在区域,列=下一期特码所在区域</div>';
html += '<table class="table table-bordered table-condensed text-center" style="max-width:600px;margin:0 auto;"><thead><tr><th style="width:80px;position:relative;"><div style="width:100%;height:35px;border-bottom:1px solid #e5e5e5;position:relative;"><span style="position:absolute;bottom:2px;right:5px;font-size:12px;">区域</span><span style="position:absolute;top:2px;left:5px;font-size:12px;">特码</span></div></th>'; html += '<table class="table table-bordered table-condensed text-center" style="max-width:600px;margin:0 auto;"><thead><tr><th style="width:80px;position:relative;"><div style="width:100%;height:35px;border-bottom:1px solid #e5e5e5;position:relative;"><span style="position:absolute;top:2px;right:5px;font-size:12px;">区域</span><span style="position:absolute;bottom:2px;left:5px;font-size:12px;">特码</span></div></th>';
for (var z = 0; z < zt.zones.length; z++) { for (var z = 0; z < zt.zones.length; z++) {
html += '<th>' + zt.zones[z] + '</th>'; html += '<th>' + zt.zones[z] + '</th>';
} }
@@ -111,6 +107,10 @@ define(['jquery'], function ($) {
html += '</tbody></table></div>'; html += '</tbody></table></div>';
} }
// 热力图部分
var hm = data.heatmap;
html += '<div class="dash-section"><h4>🎨 特码热力图</h4><div style="font-size:12px;color:#999;margin-bottom:8px;">X轴:期号(从左往右,从远到近) | Y轴:号码1-49 | 颜色:号码波色</div><div id="heatmap-chart" style="width:100%;height:500px;"></div></div>';
$('#dash-content').html(html); $('#dash-content').html(html);
// 波色饼图 // 波色饼图