class QueryCustom extends Query

Constants

protected NAME_PAGESIZE

protected NAME_PAGE

protected OBJECT_MASK

Properties

int $pagesize 分页数量 from  Query
int $usePaginate 是否使用分页 from  Query
protected int $total 分页总长度 from  Query
protected Closure $collectionCallback

对查询出来的数据集合进行回调, 参数是查询的所有数据

from  Query
protected TablePlugin $table 表格
protected int $page 当前的页码
protected int $pageOffset 页码偏移量
protected array $params

查询条件, 包含Scope

Methods

usePaginate(bool $paginate = true)

启用或者禁用分页

from  Query
int
total()

获取当前模型的总数

from  Query
collection(Closure $callback = null)

Set collection callback.

from  Query
Collection
get()

实现 Get 方法来获取数据

mixed
chunk(Closure $closure, int $amount = 100)

用于批量查询

prepare(FilterPlugin $filter, TablePlugin $table)

用户筛选查询

bool
edit($id, string $field, $value)

编辑条目

usePrimaryKey(array $ids = [])

导出 | 使用主键

mixed
getPrimaryKey()

获取主键

Details

in Query at line 49
Queryable usePaginate(bool $paginate = true)

启用或者禁用分页

Parameters

bool $paginate

Return Value

Queryable

in Query at line 60
int total()

获取当前模型的总数

Return Value

int

in Query at line 72
Queryable collection(Closure $callback = null)

Set collection callback.

Parameters

Closure $callback

Return Value

Queryable

at line 41
Collection get()

实现 Get 方法来获取数据

Return Value

Collection

at line 52
mixed chunk(Closure $closure, int $amount = 100)

用于批量查询

Parameters

Closure $closure
int $amount

Return Value

mixed

at line 63
Queryable prepare(FilterPlugin $filter, TablePlugin $table)

用户筛选查询

Parameters

FilterPlugin $filter
TablePlugin $table

Return Value

Queryable

at line 80
bool edit($id, string $field, $value)

编辑条目

Parameters

$id
string $field
$value

Return Value

bool

at line 90
Queryable usePrimaryKey(array $ids = [])

导出 | 使用主键

Parameters

array $ids

Return Value

Queryable

at line 99
mixed getPrimaryKey()

获取主键

Return Value

mixed