QueryModel
class QueryModel 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 Model | $model | Eloquent model instance of the grid model. |
|
protected Model | $origin | ||
protected Collection | $queries | Array of queries of the eloquent model. |
|
protected array|string | $sort | Sort parameters of the model. |
|
protected Relation | $relation | ||
protected array | $eagerLoads |
Methods
Create a new grid model instance.
组建数据
No description
No description
No description
调用查询方法并把参数放入到查询条件中
No description
设置分页
Resolve pagesize for pagination.
通过方法名称查找组合模型的条件
设置排序 _sort { column : type : cast : }
Set relation sort.
Build join parameters for related model.
Details
in
Query at line 60
int
total()
获取当前模型的总数
at line 74
__construct(Model $model)
Create a new grid model instance.
at line 87
Collection
get()
组建数据
at line 104
mixed
chunk(Closure $closure, int $amount = 100)
No description
at line 128
Queryable
prepare(FilterPlugin $filter, TablePlugin $table)
查询条件预取
at line 140
bool
edit($id, string $field, $value)
No description
at line 155
mixed
getPrimaryKey()
No description
at line 164
Queryable
usePrimaryKey(array $ids = [])
No description
at line 176
$this
__call(string $method, array $arguments)
调用查询方法并把参数放入到查询条件中
at line 189
protected Collection
fetchData()
No description
at line 216
protected void
setPaginate()
设置分页
at line 243
protected array
resolvePagesize(array|null $paginate)
Resolve pagesize for pagination.
at line 269
protected array|null
findQueryByMethod(string $method)
通过方法名称查找组合模型的条件
at line 285
protected void
setSort()
设置排序 _sort { column : type : cast : }
at line 328
protected void
setRelationSort(string $column)
Set relation sort.
at line 370
protected array|null
joinParameters(Relation $relation)
Build join parameters for related model.
HasOne
and BelongsTo
relation has different join parameters.