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 += '
区域特码 | ';
+ html += '
|---|
区域特码 | ';
for (var z = 0; z < zt.zones.length; z++) {
html += '' + zt.zones[z] + ' | '; } @@ -111,6 +107,10 @@ define(['jquery'], function ($) { html += '
|---|