Skip to content

Commit

Permalink
fix: error for the share list
Browse files Browse the repository at this point in the history
  • Loading branch information
saltbo committed Jul 7, 2021
1 parent 0db0d14 commit 4562766
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/app/dao/share.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ func (s *Share) Delete(id int64) error {
func (s *Share) FindAll(uid int64) (list []*model.Share, total int64, err error) {
query := NewQuery()
query.WithEq("uid", uid)
gdb.Model(model.Share{}).Count(&total)
err = gdb.Find(&list).Offset(query.Offset).Limit(query.Limit).Error
sn := gdb.Where(query.SQL(), query.Params)
sn.Model(model.Share{}).Count(&total)
err = sn.Find(&list).Offset(query.Offset).Limit(query.Limit).Error
return
}

Expand Down

0 comments on commit 4562766

Please sign in to comment.