- Issue created by @maoxuan@ciandt.com
- 🇨🇳China maoxuan@ciandt.com
Looking forward to solving this problem in the release of D10 version.
Recently I found Line 202 of UserStatisticsManager.php. The MySQL WEEK function was used to count user data, and the data was grouped by week. A problem was discovered during use. The MySQL WEEK function defaults to calculating based on Sunday, while PHP date The week number returned by W in format is calculated based on Monday, which may lead to inconsistent data statistics in extreme cases.
Submit a piece of training data on 2024-01-11, whether it is completed or to be completed. At this time, check the TRENDS chart statistics in the User Profile. You will find that Week4 has data, but Week5 has no data. According to the code logic, the valid data should be In Week5
Add an additional mode parameter when using the WEEK function in UserStatisticsManager.php line 202. Set the mode to 1 to indicate that the calculation starts on Monday. This ensures that the MySQL week function calculation is consistent with the PHP date format rules.
https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sys...
Needs review
3.1
Code
Looking forward to solving this problem in the release of D10 version.