* [perf story #74841] Not send statistical when use does not agree with the user experience.

This commit is contained in:
wangyidong
2025-06-11 09:30:55 +08:00
parent 0a121f5718
commit 609fe4e11c
+7 -1
View File
@@ -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');