From bccf1e3b1b33d977126290ca89121285900ce3bd Mon Sep 17 00:00:00 2001 From: mofangmin Date: Fri, 13 Sep 2024 12:09:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/web/handler/share.go | 6 +++--- modules/web/timer.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) 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活动排行榜数目 )