Skip to content

Commit

Permalink
edit PageOrderBy
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaowc-mac committed Sep 22, 2023
1 parent 068037c commit 4f48673
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions core/utils/page.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,12 @@ func (p *PageQuery) PageOrderBy() (db *gorm.DB, err error) {
return p.Model, err
}
if p.OrderPrefix != "" {
p.Model = model.Order(p.OrderPrefix + orderKey)
model = model.Order(p.OrderPrefix + orderKey)
} else {
p.Model = model.Order(orderKey)
model = model.Order(orderKey)
}
}
db = model.Limit(p.PageStruct.Size).Offset((p.PageStruct.Page - 1) * p.PageStruct.Size)
return
return model.Limit(p.PageStruct.Size).Offset((p.PageStruct.Page - 1) * p.PageStruct.Size), nil
}

// PageFmt Page 格式化输出
Expand Down

0 comments on commit 4f48673

Please sign in to comment.