功能修改

dev
mofangmin 1 year ago
parent 017d79fe72
commit bccf1e3b1b
  1. 6
      modules/web/handler/share.go
  2. 2
      modules/web/timer.go

@ -128,7 +128,7 @@ func ShareList(c *gin.Context) {
}
var ret []TempData
if req.Type == 1 {
err := db.Mysql().QueryCountBySql(fmt.Sprintf("SELECT count(*) FROM share_detail WHERE FROM_UNIXTIME(Time, '%%Y-%%m-%%d') = CURDATE() and up = %d GROUP BY UID ORDER BY total_reward DESC", a.UID), &resp.Count)
err := db.Mysql().QueryCountBySql(fmt.Sprintf("select count(*) from (SELECT count(*) FROM share_detail WHERE FROM_UNIXTIME(Time, '%%Y-%%m-%%d') = CURDATE() and up = %d GROUP BY UID ORDER BY SUM(reward) DESC)a", a.UID), &resp.Count)
if err != nil {
log.Error("err:%v", err)
}
@ -143,7 +143,7 @@ func ShareList(c *gin.Context) {
})
}
} else if req.Type == 2 {
err := db.Mysql().QueryCountBySql(fmt.Sprintf("SELECT count(*) FROM share_detail where up = %d GROUP BY UID ORDER BY total_reward DESC", a.UID), &resp.Count)
err := db.Mysql().QueryCountBySql(fmt.Sprintf("select count(*) from (SELECT count(*) FROM share_detail where up = %d GROUP BY UID ORDER BY SUM(reward) DESC)a", a.UID), &resp.Count)
if err != nil {
log.Error("err:%v", err)
}
@ -158,7 +158,7 @@ func ShareList(c *gin.Context) {
})
}
} else if req.Type == 3 {
err := db.Mysql().QueryCountBySql(fmt.Sprintf("SELECT count(*) FROM share_detail where up = %d GROUP BY UID ORDER BY total_reward DESC", a.UID), &resp.Count)
err := db.Mysql().QueryCountBySql(fmt.Sprintf("select count(*) from (SELECT count(*) FROM share_detail where up = %d GROUP BY UID ORDER BY SUM(recharge_amount) DESC)a", a.UID), &resp.Count)
if err != nil {
log.Error("err:%v", err)
}

@ -20,7 +20,7 @@ func FetchDatas() {
var (
FetchInterval = 5 * 60
ShareDataRankNum = 8 // 排行榜显示8个
ShareDataRankNum = 20 // 排行榜显示8个
ActivitySlotsRankNum = 10 // slots活动排行榜数目
)

Loading…
Cancel
Save