Update evolution indices and enhance user experience in mini program

- Added new entries for content ranking algorithm adjustments and cross-platform reuse in the evolution indices for backend, team, and mini program development.
- Improved user interface elements in the mini program, including the addition of a hidden settings entry and refined guidance for profile modifications.
- Enhanced reading statistics display with formatted numbers for better clarity and user engagement.
- Updated reading tracker logic to prevent duplicate duration accumulation and ensure accurate reporting of reading progress.
This commit is contained in:
Alex-larget
2026-03-14 17:13:06 +08:00
parent c936371165
commit 1edceda4db
33 changed files with 773 additions and 75 deletions

View File

@@ -540,14 +540,12 @@ func DBUsersList(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{"success": true, "user": nil})
return
}
// 填充 hasFullBookis_vip 或 orders
// 填充 hasFullBookorders、is_vip、手动设置的 has_full_book
var cnt int64
db.Model(&model.Order{}).Where("user_id = ? AND (status = ? OR status = ?) AND (product_type = ? OR product_type = ?)",
id, "paid", "completed", "fullbook", "vip").Count(&cnt)
user.HasFullBook = ptrBool(cnt > 0)
if user.IsVip != nil && *user.IsVip {
user.HasFullBook = ptrBool(true)
}
hasFull := cnt > 0 || (user.IsVip != nil && *user.IsVip) || (user.HasFullBook != nil && *user.HasFullBook)
user.HasFullBook = ptrBool(hasFull)
c.JSON(http.StatusOK, gin.H{"success": true, "user": user})
return
}
@@ -670,11 +668,14 @@ func DBUsersList(c *gin.Context) {
// 填充每个用户的实时计算字段
for i := range users {
uid := users[i].ID
// 购买状态(含手动设置的 VIPis_vip=1 且 vip_expire_date>NOW
// 购买状态(含订单、is_vip、手动设置的 has_full_book
hasFull := hasFullBookMap[uid]
if users[i].IsVip != nil && *users[i].IsVip && users[i].VipExpireDate != nil && users[i].VipExpireDate.After(time.Now()) {
hasFull = true
}
if users[i].HasFullBook != nil && *users[i].HasFullBook {
hasFull = true
}
users[i].HasFullBook = ptrBool(hasFull)
users[i].PurchasedSectionCount = sectionCountMap[uid]
// 分销收益