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
->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);