fix: 实现空间 TotalReads 统计,修复 selectMention 闭包

- P0-2: posts/show.html selectMention 闭包 var→let 修复
- P0-3: GetUserStats 增加 SUM(views_count) 统计,替换硬编码 int64(0)
- 更新 Fix_List.md 标注 P0-1/2/3 已修复
This commit is contained in:
2026-06-02 15:21:37 +08:00
parent c1ad8a0121
commit 166e01c7c3
6 changed files with 14 additions and 13 deletions

View File

@ -81,7 +81,7 @@ func (ctrl *SpaceController) ShowSpace(c *gin.Context) {
// 构建基础数据(含用户统计)
postCount, _ := ctrl.spaceService.CountUserPosts(uint(uid))
totalLikes, totalFavorites, _ := ctrl.spaceService.GetUserStats(uint(uid))
totalLikes, totalFavorites, totalReads, _ := ctrl.spaceService.GetUserStats(uint(uid))
data := gin.H{
"Title": spaceUser.Username + " 的空间",
@ -93,7 +93,7 @@ func (ctrl *SpaceController) ShowSpace(c *gin.Context) {
"PostCount": postCount,
"TotalLikes": totalLikes,
"TotalFavorites": totalFavorites,
"TotalReads": int64(0), // 暂无阅读量统计
"TotalReads": totalReads,
}
// ---- 根据 Tab 加载对应数据 ----