Properties

$tenant_id

$tenant_id : integer

租户id

Type

integer

$uid

$uid : integer

用户id

Type

integer

$noNeedLogin

$noNeedLogin : array

无需登录的方法,同时也就不需要鉴权了

Type

array

$noNeedRight

$noNeedRight : array

无需鉴权的方法,但需要登录

Type

array

$auth

$auth : \lib\Auth

权限控制类

Type

\lib\Auth

$model

$model : \think\Model

模型对象

Type

\think\Model

$whereFields

$whereFields : 

where条件字段

Type

$searchFields

$searchFields : 

快速搜索时执行查找的字段

Type

$statusField

$statusField : \app\common\controller\bool,string

是否开启状态筛选,默认false

Type

\app\common\controller\bool,string

$relationSearch

$relationSearch : 

是否是关联查询

Type

$dataLimit

$dataLimit : 

是否开启数据限制 支持auth/personal 表示按权限判断/仅限个人 默认为禁用,若启用请务必保证表中存在admin_id字段

Type

$dataLimitField

$dataLimitField : 

数据限制字段

Type

$dataLimitFieldAutoFill

$dataLimitFieldAutoFill : 

数据限制开启时自动填充限制字段值

Type

$validate

$validate : 

验证模型类

Type

$modelSceneValidate

$modelSceneValidate : 

是否开启模型场景验证

Type

$validateAction

$validateAction : 

需要模型验证的方法

Type

$multiFields

$multiFields : 

Multi方法可批量修改的字段

Type

$selectpageFields

$selectpageFields : 

Selectpage可显示的字段

Type

$defaultSort

$defaultSort : \app\common\controller\null,array,string

默认排序字段,请求参数中不包含“sort”字段时生效 格式为TP5.1 order条件格式

Type

\app\common\controller\null,array,string

$importHeadType

$importHeadType : 

导入文件首行类型 支持comment/name 表示注释或字段名

Type

$with

$with : 

关联预载入,支持数组或文本类型

Type

Methods

index()

index() 

显示数据集 Author: websky

recyclebin()

recyclebin() 

回收站 Author: websky

detailed()

detailed(integer  $id) : array

详细信息 Author: websky

Parameters

integer $id

Returns

array

add()

add() : array

新增数据 Author: websky

Returns

array

edit()

edit(integer  $id) : array

更新数据 Author: websky

Parameters

integer $id

Returns

array

del()

del(integer  $id = '') : array

删除数据 Author: websky

Parameters

integer $id

Returns

array

destroy()

destroy(string  $id = '') 

真实删除 Author: websky

Parameters

string $id

restore()

restore(string  $id = '') 

还原 Author: websky

Parameters

string $id

multi()

multi(string  $ids = '') 

批量更新 Author: websky

Parameters

string $ids

editfield()

editfield() 

字段修改 Author: websky

read()

read(integer  $id) : array

显示指定的资源 Author: websky

Parameters

integer $id

Returns

array

save()

save() : array

保存新建数据 Author: websky

Returns

array

initialize()

initialize() 

_empty()

_empty() 

validateAuto()

validateAuto(array  $data = array(), string|array  $validate = '', array  $message = array(), boolean  $batch = false, mixed  $callback = null) : array|string|true

模型验证控制器(无参数根据验证模型类自动验证) Author: websky

Parameters

array $data

数据

string|array $validate

验证器名或者验证规则数组

array $message

提示信息

boolean $batch

是否批量验证

mixed $callback

回调方法(闭包)

Throws

\app\common\controller\ValidateException

Returns

array|string|true

whereBuild()

whereBuild(null  $searchfields = null, null  $relationSearch = null) : array

生成条件 where参数接收JSON字符串('{"description":"websky","name":["test","LIKE"],"":["status",">","-1"]}') Author: websky

Parameters

null $searchfields
null $relationSearch

Returns

array

whereKey()

whereKey(null  $field = null) : array|boolean

生成搜索条件 Author: websky

Parameters

null $field

只检索字段

Returns

array|boolean

whereStatus()

whereStatus(string  $field = '') : array|boolean

生成状态条件,默认“status”,可以通过私有变量“$this->statusField”来改变

Parameters

string $field

为true则使用此字段

Returns

array|boolean

whereTime()

whereTime() : \app\common\controller\multitype:multitype:string

生成时间查询条件(开始-结束时间)

Returns

\app\common\controller\multitype:multitype:string —

multitype:string multitype:string unknown multitype:string mixed

buildParam()

buildParam(array  $array = array()) : array

数据库字段 网页字段转换 Author: websky

Parameters

array $array

要转化数组

Returns

array

param()

param(  $name = '', string  $type = 'param') : mixed

获取指定的参数 Author: websky

Parameters

$name
string $type

Returns

mixed

isParam()

isParam(string  $param = 'id') : array|integer|string

判断参数是否为空 Author: websky

Parameters

string $param

Returns

array|integer|string

reSuccess()

reSuccess(  $data = 1, integer  $code, string  $msg = '成功', array  $header = array()) 

返回封装后的Success Author: websky

Parameters

$data
integer $code
string $msg
array $header

reError()

reError(integer  $code = 999, string  $msg = '', array  $header = array()) 

返回封装后的Error Author: websky

Parameters

integer $code
string $msg
array $header

reTable()

reTable(array  $data = array(), integer  $count = 10, integer  $code, string  $msg = '') 

返回Table json数据 Author: websky

Parameters

array $data
integer $count
integer $code
string $msg

match()

match(array  $arr = array()) : boolean

检测当前控制器和方法是否匹配传递的数组 Author: websky

Parameters

array $arr

需要验证权限的数组

Returns

boolean