$autoWriteTimestamp
$autoWriteTimestamp : boolean|string
是否需要自动写入时间戳 如果设置为字符串 则表示时间字段的类型
Class Model
$queryInstance : \think\db\Query
查询对象实例
$hidden : array
数据输出隐藏的属性
withTrashed() : \think\db\Query
查询软删除数据
onlyTrashed() : \think\db\Query
只查询软删除数据
newInstance(array|object $data = array(), boolean $isUpdate = false, mixed $where = null) : \think\Model
创建新的模型实例
| array|object | $data | 数据  | 
                            
| boolean | $isUpdate | 是否为更新  | 
                            
| mixed | $where | 更新条件  | 
                            
setQuery(\think\db\Query  $query) : $this
                获取当前模型的数据库查询对象
| \think\db\Query | $query | 查询对象实例  | 
                            
db(boolean|array  $useBaseQuery = true) : \think\db\Query
                获取当前模型的数据库查询对象
| boolean|array | $useBaseQuery | 是否调用全局查询范围(或者指定查询范围名称)  | 
                            
saveAll(array $dataSet, boolean $replace = true) : \think\Collection
保存多个数据到当前数据对象
| array | $dataSet | 数据  | 
                            
| boolean | $replace | 是否自动识别更新和写入  | 
                            
useGlobalScope(boolean|array  $use) : \think\db\Query
                设置是否使用全局查询范围
| boolean|array | $use | 是否启用全局查询范围(或者用数组指定查询范围名称)  | 
                            
setParent(\think\Model  $model) : $this
                设置父关联对象
| \think\Model | $model | 模型对象  | 
                            
getParent() : \think\Model
获取父关联对象
has(string $relation, mixed $operator = '>=', integer $count = 1, string $id = '*', string $joinType = 'INNER') : \think\db\Query
根据关联条件查询当前模型
| string | $relation | 关联方法名  | 
                            
| mixed | $operator | 比较操作符  | 
                            
| integer | $count | 个数  | 
                            
| string | $id | 关联表的统计字段  | 
                            
| string | $joinType | JOIN类型  | 
                            
hasWhere(string $relation, mixed $where = array(), mixed $fields = '*') : \think\db\Query
根据关联条件查询当前模型
| string | $relation | 关联方法名  | 
                            
| mixed | $where | 查询条件(数组或者闭包)  | 
                            
| mixed | $fields | 字段  | 
                            
eagerlyResult(\think\Model $result, string $relation, array $withRelationAttr = array(), boolean $join = false) : \think\Model
预载入关联查询 返回模型对象
| \think\Model | $result | 数据对象  | 
                            
| string | $relation | 关联名  | 
                            
| array | $withRelationAttr | 关联获取器  | 
                            
| boolean | $join | 是否为JOIN方式  | 
                            
relationCount(\think\Model $result, array $relations, string $aggregate = 'sum', string $field = '*') : void
关联统计
| \think\Model | $result | 数据对象  | 
                            
| array | $relations | 关联名  | 
                            
| string | $aggregate | 聚合查询方法  | 
                            
| string | $field | 字段  | 
                            
hasOne(string $model, string $foreignKey = '', string $localKey = '') : \think\model\relation\HasOne
HAS ONE 关联定义
| string | $model | 模型名  | 
                            
| string | $foreignKey | 关联外键  | 
                            
| string | $localKey | 当前主键  | 
                            
belongsTo(string $model, string $foreignKey = '', string $localKey = '') : \think\model\relation\BelongsTo
BELONGS TO 关联定义
| string | $model | 模型名  | 
                            
| string | $foreignKey | 关联外键  | 
                            
| string | $localKey | 关联主键  | 
                            
hasMany(string $model, string $foreignKey = '', string $localKey = '') : \think\model\relation\HasMany
HAS MANY 关联定义
| string | $model | 模型名  | 
                            
| string | $foreignKey | 关联外键  | 
                            
| string | $localKey | 当前主键  | 
                            
hasManyThrough(string $model, string $through, string $foreignKey = '', string $throughKey = '', string $localKey = '') : \think\model\relation\HasManyThrough
HAS MANY 远程关联定义
| string | $model | 模型名  | 
                            
| string | $through | 中间模型名  | 
                            
| string | $foreignKey | 关联外键  | 
                            
| string | $throughKey | 关联外键  | 
                            
| string | $localKey | 当前主键  | 
                            
belongsToMany(string $model, string $table = '', string $foreignKey = '', string $localKey = '') : \think\model\relation\BelongsToMany
BELONGS TO MANY 关联定义
| string | $model | 模型名  | 
                            
| string | $table | 中间表名  | 
                            
| string | $foreignKey | 关联外键  | 
                            
| string | $localKey | 当前模型关联键  | 
                            
morphOne(string $model, string|array $morph = null, string $type = '') : \think\model\relation\MorphOne
MORPH One 关联定义
| string | $model | 模型名  | 
                            
| string|array | $morph | 多态字段信息  | 
                            
| string | $type | 多态类型  | 
                            
morphMany(string $model, string|array $morph = null, string $type = '') : \think\model\relation\MorphMany
MORPH MANY 关联定义
| string | $model | 模型名  | 
                            
| string|array | $morph | 多态字段信息  | 
                            
| string | $type | 多态类型  | 
                            
morphTo(string|array $morph = null, array $alias = array()) : \think\model\relation\MorphTo
MORPH TO 关联定义
| string|array | $morph | 多态字段信息  | 
                            
| array | $alias | 多态别名定义  | 
                            
toCollection(array|\think\Collection $collection, string $resultSetType = null) : \think\Collection
转换数据集为数据集对象
| array|\think\Collection | $collection | 数据集  | 
                            
| string | $resultSetType | 数据集类  | 
                            
withNoTrashed(\think\db\Query  $query) : void
                查询的时候默认排除软删除数据
| \think\db\Query | $query | 
buildQuery() : \think\db\Query
创建模型的查询对象
getRelationData(\think\model\Relation  $modelRelation) : mixed
                智能获取关联模型数据
| \think\model\Relation | $modelRelation | 模型关联对象  |