\Admin\ControllerApplyBatchController

后台公共控制器 为什么要继承AdminController? 因为AdminController的初始化函数中读取了顶部导航栏和左侧的菜单, 如果不继承的话,只能复制AdminController中的代码来读取导航栏和左侧的菜单。 这样做会导致一个问题就是当AdminController被官方修改后不会同步更新,从而导致错误。 所以综合考虑还是继承比较好。

Summary

Methods
Properties
Constants
_initialize()
setStatus()
module_config()
extendDates()
__construct()
__set()
get()
__get()
__isset()
__call()
getGroups()
index()
applyList()
taskList()
taskDetail()
applyForm()
addTaskIndex()
addTaskForm()
downloadZip()
No public properties found
No constants found
editRow()
display()
show()
fetch()
theme()
assign()
error()
success()
ajaxReturn()
redirect()
$view
$config
N/A
dispatchJump()
No private properties found
N/A

Properties

$view

$view : \Think\view

视图实例对象

Type

\Think\view

$config

$config : \Think\config

控制器参数

Type

\Think\config

Methods

_initialize()

_initialize() 

author Gentle intro 类初始化方法 param return

setStatus()

setStatus(  $model = CONTROLLER_NAME,   $script = false) 

设置一条或者多条数据的状态

Parameters

$model
$script

严格模式要求处理的纪录的uid等于当前登陆用户UID

module_config()

module_config() 

模块配置方法

extendDates()

extendDates(  $map, string  $field = 'update_time', string  $type = 'datetime', boolean  $not_empty = false) 

扩展日期搜索map

Parameters

$map

array 引用型

string $field

搜索的时间范围字段

string $type

datetime 类型 或 timestamp 时间戳

boolean $not_empty

是否允许空值搜索到

__construct()

__construct() 

架构函数 取得模板对象实例

__set()

__set(  $name,   $value) 

Parameters

$name
$value

get()

get(string  $name = '') : mixed

取得模板显示变量的值

Parameters

string $name

模板显示变量

Returns

mixed

__get()

__get(  $name) 

Parameters

$name

__isset()

__isset(string  $name) : boolean

检测模板变量的值

Parameters

string $name

名称

Returns

boolean

__call()

__call(string  $method, array  $args) : mixed

魔术方法 有不存在的操作的时候执行

Parameters

string $method

方法名

array $args

参数

Returns

mixed

getGroups()

getGroups() 

author Gentle intro 获取用户组 param

index()

index() 

author Gentle intro 申请批次首页 param

applyList()

applyList() 

author Gentle intro 申请批次列表页面 param

taskList()

taskList() 

author Gentle intro 任务列表页面 param

taskDetail()

taskDetail() 

author Gentle intro 任务详情页面 param 2017年9月15日15:31:22

applyForm()

applyForm() 

author Gentle intro 申请批次方法 param return bool

addTaskIndex()

addTaskIndex() 

author Gentle intro 批次补单申请页面 param

addTaskForm()

addTaskForm() 

author Gentle intro 批次补单申请方法 param

downloadZip()

downloadZip() 

author Gentle intro 调用下载函数 param

editRow()

editRow(string  $model, array  $data, array  $map, array  $msg) 

对数据表中的单行或多行记录执行修改 GET参数id为数字或逗号分隔的数字

Parameters

string $model

模型名称,供M函数使用的参数

array $data

修改的数据

array $map

查询时的where()方法的参数

array $msg

执行正确和错误的消息 array( 'success' => '', 'error' => '', 'url' => '', // url为跳转页面 'ajax' => false //是否ajax(数字则为倒数计时) )

display()

display(string  $templateFile = '', string  $charset = '', string  $contentType = '', string  $content = '', string  $prefix = '') : void

模板显示 调用内置的模板引擎显示方法,

Parameters

string $templateFile

指定要调用的模板文件 默认为空 由系统自动定位模板文件

string $charset

输出编码

string $contentType

输出类型

string $content

输出内容

string $prefix

模板缓存前缀

show()

show(string  $content, string  $charset = '', string  $contentType = '', string  $prefix = '') : mixed

输出内容文本可以包括Html 并支持内容解析

Parameters

string $content

输出内容

string $charset

模板输出字符集

string $contentType

输出类型

string $prefix

模板缓存前缀

Returns

mixed

fetch()

fetch(string  $templateFile = '', string  $content = '', string  $prefix = '') : string

获取输出页面内容 调用内置的模板引擎fetch方法,

Parameters

string $templateFile

指定要调用的模板文件 默认为空 由系统自动定位模板文件

string $content

模板输出内容

string $prefix

模板缓存前缀*

Returns

string

theme()

theme(string  $theme) : \Think\Action

模板主题设置

Parameters

string $theme

模版主题

Returns

\Think\Action

assign()

assign(mixed  $name, mixed  $value = '') : \Think\Action

模板变量赋值

Parameters

mixed $name

要显示的模板变量

mixed $value

变量的值

Returns

\Think\Action

error()

error(string  $message = '', string  $jumpUrl = '', mixed  $ajax = false) : void

操作错误跳转的快捷方法

Parameters

string $message

错误信息

string $jumpUrl

页面跳转地址

mixed $ajax

是否为Ajax方式 当数字时指定跳转时间

success()

success(string  $message = '', string  $jumpUrl = '', mixed  $ajax = false) : void

操作成功跳转的快捷方法

Parameters

string $message

提示信息

string $jumpUrl

页面跳转地址

mixed $ajax

是否为Ajax方式 当数字时指定跳转时间

ajaxReturn()

ajaxReturn(mixed  $data, String  $type = '', integer  $json_option) : void

Ajax方式返回数据到客户端

Parameters

mixed $data

要返回的数据

String $type

AJAX返回数据格式

integer $json_option

传递给json_encode的option参数

redirect()

redirect(string  $url, array  $params = array(), integer  $delay, string  $msg = '') : void

Action跳转(URL重定向) 支持指定模块和延时跳转

Parameters

string $url

跳转的URL表达式

array $params

其它URL参数

integer $delay

延时跳转的时间 单位为秒

string $msg

跳转提示信息

dispatchJump()

dispatchJump(string  $message, Boolean  $status = 1, string  $jumpUrl = '', mixed  $ajax = false) : void

默认跳转操作 支持错误导向和正确跳转 调用模板显示 默认为public目录下面的success页面 提示页面为可配置 支持模板标签

Parameters

string $message

提示信息

Boolean $status

状态

string $jumpUrl

页面跳转地址

mixed $ajax

是否为Ajax方式 当数字时指定跳转时间