From 609fe4e11cd8a6e5b6cad10e09fdab972a9e5f87 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 29 May 2025 13:43:27 +0800 Subject: [PATCH] * [perf story #74841] Not send statistical when use does not agree with the user experience. --- module/misc/model.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/module/misc/model.php b/module/misc/model.php index 098c481b85..65555bab3a 100644 --- a/module/misc/model.php +++ b/module/misc/model.php @@ -290,11 +290,17 @@ class miscModel extends model */ public function getStatisticsForAPI(): array { + /* + 如果用户不同意用户体验,则不返回统计数据。 + If the user does not agree with the user experience, do not return statistical data. + */ + if(empty($this->config->global->enableUX)) return array(); + $data = array(); if(isset($this->config->misc->statistics)) { $statistics = json_decode($this->config->misc->statistics, true); - if(helper::today() == $statistics['date']) return array(); //每天只统计一次 + if(helper::today() == $statistics['date']) return $statistics['data']; // Only statistics once a day } $data['user'] = $this->dao->select('COUNT(id) AS count')->from(TABLE_USER)->where('deleted')->eq(0)->fetch('count');