-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### 现状 目前数据统计功能在web侧得时间日期筛选,进入到server端及数据库会以utc 时间 来进行搜索,但大部分用户其实是希望以自己所在时区进行日期筛选。 举例: 关于1-17到1-23号的用户活跃数的统计 如果以0时区进行统计: ![img_v3_027c_c7a6c6e5-f096-47dc-85e3-3b79e15fc33g](https://github.com/PKUHPC/SCOW/assets/130351655/6251e5c7-4e96-4372-99d4-c16e4d24fece) 但是数据库里其实 2024-01-22 的记录是八时区的01-23号产生的(2024-01-22 20:56:09.789000),所以正确的结果应该如下(sql将0时区转为8时区后计算) ![img_v3_027c_8ab313d4-fdaf-4799-bcfc-5c17314d1f8g](https://github.com/PKUHPC/SCOW/assets/130351655/14d13d8d-da97-4bfa-b980-06559a42021d) ### 改动 GetDailyCharge,GetDailyPay,GetNewJobCount,GetNewUserCount,GetActiveUserCount 接口增加时区参数,在数据库进行搜索时以传参时区进行转换(没传就默认为UTC时区),客户端侧通过Intl.DateTimeFormat().resolvedOptions().timeZone 获取当前时区。
- Loading branch information
1 parent
efcd9a8
commit 443187e
Showing
33 changed files
with
602 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@scow/grpc-api": minor | ||
--- | ||
|
||
GetDailyCharge,GetDailyPay,GetNewJobCount,GetNewUserCount,GetActiveUserCount 接口新增 time_zone 参数以及返回类型由时间戳改为 date |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
"@scow/audit-server": patch | ||
"@scow/mis-server": patch | ||
"@scow/mis-web": patch | ||
"@scow/lib-server": patch | ||
--- | ||
|
||
修复数据统计相关功能时区转换问题 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.