Skip to content

Commit

Permalink
add new
Browse files Browse the repository at this point in the history
  • Loading branch information
idprm committed Dec 2, 2024
1 parent 2be0c2f commit b6495dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/domain/repository/paginate_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func PaginateMenus(value interface{}, pagination *entity.Pagination, db *gorm.DB

func PaginateNews(value interface{}, pagination *entity.Pagination, db *gorm.DB) func(db *gorm.DB) *gorm.DB {
var totalRows int64
db.Model(value).Where("UPPER(name) LIKE UPPER(?)", "%"+pagination.GetSearch()+"%").Count(&totalRows)
db.Model(value).Where("UPPER(title) LIKE UPPER(?)", "%"+pagination.GetSearch()+"%").Count(&totalRows)

pagination.TotalRows = totalRows
totalPages := int(math.Ceil(float64(totalRows) / float64(pagination.Limit)))
Expand Down

0 comments on commit b6495dd

Please sign in to comment.