black bug

This commit is contained in:
wangchuxiao
2023-03-16 19:00:17 +08:00
parent 92d941b747
commit 73e6fbbe91
8 changed files with 84 additions and 160 deletions
+4
View File
@@ -20,3 +20,7 @@ func NewMetaDB(db *gorm.DB, table any) *MetaDB {
func (g *MetaDB) db(ctx context.Context) *gorm.DB {
return g.DB.WithContext(ctx).Model(g.table)
}
func (g *MetaDB) page(pageNumber, showNumber int32) *gorm.DB {
return g.DB.Limit(int(showNumber)).Offset(int(pageNumber*showNumber-1))
}