From 00a46cee8d990f4d5e0491d6269964ea0e342160 Mon Sep 17 00:00:00 2001 From: tianya Date: Sun, 28 May 2023 14:42:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=86=E5=8F=B2=E8=AE=B0=E5=BD=95=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E5=8E=86=E5=8F=B2=E5=B3=B0=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/admin/index_body.php | 2 +- src/admin/templets/index_body.htm | 2 +- src/system/libraries/statistics.class.php | 13 +++++-------- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/admin/index_body.php b/src/admin/index_body.php index 045d71de..1ab5202d 100644 --- a/src/admin/index_body.php +++ b/src/admin/index_body.php @@ -73,7 +73,7 @@ if (empty($dopost)) { )); exit; } - if (empty($cfg_auth_code)) { + if (empty(trim($cfg_auth_code))) { echo json_encode(array( "code" => -1002, "msg" => "当前站点已授权社区版,获取更多官方技术支持,请选择商业版", diff --git a/src/admin/templets/index_body.htm b/src/admin/templets/index_body.htm index f055ac4f..006645f0 100644 --- a/src/admin/templets/index_body.htm +++ b/src/admin/templets/index_body.htm @@ -50,7 +50,7 @@ 0 - 历史记录 + 历史峰值 0 0 0 diff --git a/src/system/libraries/statistics.class.php b/src/system/libraries/statistics.class.php index ce4a288f..548d27c2 100644 --- a/src/system/libraries/statistics.class.php +++ b/src/system/libraries/statistics.class.php @@ -137,16 +137,13 @@ class DedeStatistics { { global $dsql; if ($d == -1) { - $pv = $dsql->GetOne("SELECT SUM(pv) as total FROM `#@__statistics`"); - $uv = $dsql->GetOne("SELECT SUM(uv) as total FROM `#@__statistics`"); - $ip = $dsql->GetOne("SELECT SUM(ip) as total FROM `#@__statistics`"); - $vv = $dsql->GetOne("SELECT SUM(vv) as total FROM `#@__statistics`"); + $row = $dsql->GetOne("SELECT * FROM `#@__statistics`ORDER BY pv DESC "); return array( "sdate" => $d, - "pv" => $pv['total'], - "uv" => $uv['total'], - "ip" => $ip['total'], - "vv" => $vv['total'], + "pv" => $row['pv'], + "uv" => $row['uv'], + "ip" => $row['ip'], + "vv" => $row['vv'], ); } $today = MyDate("Ymd",time());