Properties

$deleteTime

$deleteTime : 

Type

$autoWriteTimestamp

$autoWriteTimestamp : 

Type

$readonly

$readonly : 

Type

$tenant_id

$tenant_id : 

Type

$uid

$uid : 

Type

$globalScope

$globalScope : 

Type

$type

$type : 

Type

Methods

__construct()

__construct(  $data = array()) 

Parameters

$data

setConfig()

setConfig(  $data = array()) : integer|string

设置模型参数

Parameters

$data

Returns

integer|string

setTenantId()

setTenantId(  $value) : integer|string

设置租户id

Parameters

$value

Returns

integer|string

getTenantId()

getTenantId() : integer

返回租户id

Returns

integer

setUid()

setUid(  $value) : integer|string

设置用户id

Parameters

$value

Returns

integer|string

scopeTenantId()

scopeTenantId(  $query) 

Parameters

$query

Grade()

Grade() : $this

部门等级,一对一关联 Author: websky

Returns

$this

getChildIds()

getChildIds(integer  $code, boolean  $withself = true, boolean  $isChildren = false) : array

返回子ID

Parameters

integer $code
boolean $withself
boolean $isChildren

是否返回子孙数组

Throws

\think\db\exception\DataNotFoundException
\think\db\exception\ModelNotFoundException
\think\exception\DbException

Returns

array

getChildren()

getChildren(integer  $code, boolean  $withself = true) : array

返回子孙数组

Parameters

integer $code

节点id

boolean $withself

是否包含自身id

Throws

\think\db\exception\DataNotFoundException
\think\db\exception\ModelNotFoundException
\think\exception\DbException

Returns

array

getChild()

getChild(integer  $code, boolean  $withself = true, boolean  $isChildren = false) : array

返回子数组

Parameters

integer $code

节点id

boolean $withself

是否包含自身id

boolean $isChildren

是否返回子孙数组

Throws

\think\db\exception\DataNotFoundException
\think\db\exception\ModelNotFoundException
\think\exception\DbException

Returns

array

getDeptArray()

getDeptArray(string  $where = '', string  $field = 'code as id,pid,name,sort', integer  $cache = 600) : array|\PDOStatement|string|\think\Collection

返回部门数组(缓存)

Parameters

string $where
string $field
integer $cache

Throws

\think\db\exception\DataNotFoundException
\think\db\exception\ModelNotFoundException
\think\exception\DbException

Returns

array|\PDOStatement|string|\think\Collection

getCreateTimeAttr()

getCreateTimeAttr(  $value) 

Parameters

$value

getUpdateTimeAttr()

getUpdateTimeAttr(  $value) 

Parameters

$value

init()

init() 

mapBuild()

mapBuild(  $field,   $condition, null  $op = null) : array

条件表达式生成 Author: websky

Parameters

$field

字段名

$condition

查询条件

null $op

查询表达式

Returns

array