Properties

$request

$request : \think\facade\Request

Type

\think\facade\Request — Request 实例

$noNeedLogin

$noNeedLogin : array

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

Type

array

$noNeedRight

$noNeedRight : array

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

Type

array

$beforeActionList

$beforeActionList : array

Type

array — 前置操作方法列表

$responseType

$responseType : string

默认响应输出类型,支持json/xml

Type

string

Methods

__construct()

__construct() 

构造方法

index()

index() : \think\response\View

获取数据库中表的列表信息

Returns

\think\response\View

add()

add() 

添加

editshow()

editshow(  $ids = null) 

编辑

Parameters

$ids

edit()

edit(  $ids = null) 

编辑

Parameters

$ids

del()

del(  $ids = "") 

删除

Parameters

$ids

quickquery()

quickquery() : \think\response\Json

快速查询

Throws

\Exception

Returns

\think\response\Json

quickquerydo()

quickquerydo(  $sql) : \think\response\Json

快速查询

Parameters

$sql

Throws

\Exception

Returns

\think\response\Json

repair()

repair() : \think\response\Json

表的修复

Throws

\Exception

Returns

\think\response\Json

optimize()

optimize() : \think\response\Json

表的优化

Throws

\Exception

Returns

\think\response\Json

backuplst()

backuplst() 

dbbackup()

dbbackup() 

restore()

restore() : \think\response\Json

数据还原

Throws

\Exception

Returns

\think\response\Json

delbackup()

delbackup() : \think\response\Json

删除备份

Throws

\Exception

Returns

\think\response\Json

download()

download() : \think\response\Json

备份下载

Throws

\Exception

Returns

\think\response\Json

dictionary()

dictionary() 

_initialize()

_initialize() 

初始化操作

loadlang()

loadlang(string  $name) 

加载语言文件

Parameters

string $name

success()

success(string  $msg = '', mixed  $data = null, integer  $code = 1, string  $type = null, array  $header = array()) 

操作成功返回的数据

Parameters

string $msg

提示信息

mixed $data

要返回的数据

integer $code

错误码,默认为1

string $type

输出类型

array $header

发送的 Header 信息

error()

error(string  $msg = '', mixed  $data = null, integer  $code, string  $type = null, array  $header = array()) 

操作失败返回的数据

Parameters

string $msg

提示信息

mixed $data

要返回的数据

integer $code

错误码,默认为0

string $type

输出类型

array $header

发送的 Header 信息

result()

result(mixed  $msg, mixed  $data = null, integer  $code, string  $type = null, array  $header = array()) : void

返回封装后的 API 数据到客户端

Parameters

mixed $msg

提示信息

mixed $data

要返回的数据

integer $code

错误码,默认为0

string $type

输出类型,支持json/xml/jsonp

array $header

发送的 Header 信息

Throws

\think\exception\HttpResponseException

preExcludeFields()

preExcludeFields(  $params) : array

排除前台提交过来的字段

Parameters

$params

Returns

array