pagenation

package
v0.0.0-...-1e877d2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TOTAL_PAGE_FIELD   = "total_page"
	PAGE_FIELD         = "page"
	ROWS_FIELD         = "rows"
	TOTAL_RECORD_FIELD = "total_record"
)
View Source
const (
	ListRow = 20
)

Variables

This section is empty.

Functions

func CommaPaginator

func CommaPaginator(page int, listRow int, total int) map[string]int

*

	page 当前页
	listRow 每页行数
    total   数据总数

	分页数据填充 返回
		=> map[string]int
			["total_page"] => 1,
			["page"] => 1,
			["rows"] => 20,
			["total_record"] => 3,
    author Bill

func PagenationParse

func PagenationParse(page int, limitRow int) string

* 页面计算(用于sql解析) 比如 1 页面 20 行 => LIMIT 0,20 比如取第五页 => 80,20 @author Bill

func PagenationStart

func PagenationStart(page int, limitRow int) int

* 页面计算(开始于结束步长区间) @author Bill

func QueryBuild

func QueryBuild(querySql string, currPage int, usePage bool) string

*

当前sql + LIMIT 0,20 [分页sql]

func QueryTotalBuild

func QueryTotalBuild(tableName string, otherCondi string, alias string) string

*

汇总sql这里直接使用sql

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL