datatable

package
v0.0.0-...-800783e Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Copyright 2016 Wenhui Shen <www.webx.top>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() client.Client

Types

type DataTable

type DataTable struct {
	*X.Context
	*database.Orm
	// contains filtered or unexported fields
}

func (*DataTable) Data

func (a *DataTable) Data(data interface{}) (r *map[string]interface{})

结果数据

func (*DataTable) GenOrderBy

func (a *DataTable) GenOrderBy(args ...func(string, string) string) string

生成 ORDER BY 子句

func (*DataTable) GenSearch

func (a *DataTable) GenSearch(fields ...string) string

生成搜索条件

func (*DataTable) Init

func (a *DataTable) Init(c *X.Context, orm *database.Orm, m interface{}) client.Client

func (*DataTable) Offset

func (a *DataTable) Offset() int64

func (*DataTable) PageSize

func (a *DataTable) PageSize() int64

func (*DataTable) Pages

func (a *DataTable) Pages() int64

总页数

func (*DataTable) SetCount

func (a *DataTable) SetCount(fn func() int64) client.Client

type Sort

type Sort struct {
	Field      string
	TableField string
	Sort       string
}

type Sorts

type Sorts []*Sort

func (Sorts) Each

func (a Sorts) Each(f func(string, string))

func (*Sorts) Insert

func (a *Sorts) Insert(index int, field string, tableField string, sort string)

func (Sorts) Sql

func (a Sorts) Sql(args ...func(string, string) string) (r string)

Jump to

Keyboard shortcuts

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