diff --git a/modules/web/handler/share.go b/modules/web/handler/share.go index 768e9e1..cafe2e1 100644 --- a/modules/web/handler/share.go +++ b/modules/web/handler/share.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) } diff --git a/modules/web/timer.go b/modules/web/timer.go index 67d301f..f487830 100644 --- a/modules/web/timer.go +++ b/modules/web/timer.go @@ -20,7 +20,7 @@ func FetchDatas() { var ( FetchInterval = 5 * 60 - ShareDataRankNum = 8 // 排行榜显示8个 + ShareDataRankNum = 20 // 排行榜显示8个 ActivitySlotsRankNum = 10 // slots活动排行榜数目 )