Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Filter ¶
func Filter(where []*QueryCondition) *xorm.Session
func FilterWhereAnd ¶
Types ¶
type Paginator ¶
type Paginator struct {
Page int //当前页 `json:"page"`
Pages []int //页码数组 `json:"pages"`
PageSize int //每页条数
TotalPage int //总页码
TotalCount int //总条数
FirstPage int //上一页
FirstPageIs bool
LastPageIs bool //
LastPage int //尾页
NextPageIs bool //
NextPage int //下一页
Data []interface{} `json:"data"`
OtherData map[string]interface{}
Offset int
}
分页
type QueryCondition ¶
type QueryCondition struct {
Field string //字段
Operation string //操作 =,!=,>,<,>=,<=,in,not in
Condition interface{} //具体值
}
查询条件
func AddQueryCondition ¶
func AddQueryCondition(field, operation string, condition interface{}) *QueryCondition
添加条件
func NewMakeQueryCondition ¶
func NewMakeQueryCondition() []*QueryCondition
Click to show internal directories.
Click to hide internal directories.