From cdde214ae904c4c3fb6905000168daa0d1532084 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Fri, 27 Dec 2024 14:37:22 +0800 Subject: [PATCH] fix: add query by page --- src/implement/user_implement.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/implement/user_implement.go b/src/implement/user_implement.go index 7844045..a1d08d7 100644 --- a/src/implement/user_implement.go +++ b/src/implement/user_implement.go @@ -143,7 +143,7 @@ func (u UserDb) UserFindAndCount(uid int64, phone string, nickname string, level if level != 0 { session = session.Where("level=?", level) } - total, err := session.FindAndCount(&m) + total, err := session.Limit(limit, (page-1)*limit).FindAndCount(&m) if err != nil { return nil, 0, zhios_order_relate_logx.Error(err) }