'生效', 2 => '失效', ); return array ( # 表名 'name' => 'auth', # 显示给用户看的名称 'lang' => '功能权限设置', 'menu' => false, # 数据结构 'struct' => array ( 'id' => array ( 'type' => 'int-11', 'name' => 'ID', 'default' => '', 'desc' => '', 'match' => 'is_numeric', 'order' => 'desc', ), 'project' => array ( 'type' => 'varchar-50', 'name' => '项目key', 'default' => '', 'desc' => '请输入项目key', 'match' => 'is_string', 'update' => 'text', 'list' => true, ), 'project_name' => array ( 'type' => 'varchar-50', 'name' => '项目名', 'default' => '', 'desc' => '请输入项目名', 'match' => 'is_string', 'update' => 'text', 'search' => 'order,fulltext', 'list' => true, ), 'name' => array ( 'type' => 'varchar-50', 'name' => '权限名', 'default' => '', 'desc' => '请输入权限名', 'match' => 'is_string', 'update' => 'text', 'search' => 'order,fulltext', 'list' => true, ), 'auth_id' => array ( 'type' => 'int-11', 'name' => '上级权限', 'default' => '-1', 'desc' => '请选择上级权限', 'match' => 'is_numeric', 'update' => 'select', 'search' => 'order,select', 'list' => '{auth_id} > 0 ? Dever::load("manage/auth-one#name", {auth_id}) : "父级权限"', ), 'key' => array ( 'type' => 'varchar-100', 'name' => '权限key', 'default' => '', 'desc' => '请输入权限key', 'match' => 'is_string', 'update' => 'text', 'search' => 'fulltext', 'list' => true, ), 'value' => array ( 'type' => 'varchar-30', 'name' => '对应的值', 'default' => '', 'desc' => '请输入对应的值', 'match' => 'is_string', 'update' => 'text', 'search' => 'fulltext', 'list' => true, ), 'state' => array ( 'type' => 'tinyint-1', 'name' => '状态', 'default' => '1', 'desc' => '请选择状态', 'match' => array('is_numeric', 1), 'option' => $option, 'update' => 'radio', 'list' => true, ), 'cdate' => array ( 'type' => 'int-11', 'name' => '录入时间', 'match' => array('is_numeric', time()), 'desc' => '', # 只有insert时才生效 'insert' => true, 'list' => 'date("Y-m-d H:i:s", {cdate})', ), ), # request 请求接口定义 'request' => array ( 'key' => array ( 'where' => array ( 'key' => 'yes', ), 'type' => 'one', ), 'project' => array ( 'where' => array ( 'state' => 1, ), 'type' => 'all', 'group' => 'project,project_name', 'col' => 'project,project_name', ), # main 取所有主栏目 'main' => array ( 'where' => array ( 'auth_id' => -1, 'state' => 1, ), 'type' => 'all', 'order' => array('id', 'desc'), 'col' => '*|project|id|', ), # 取所有下级栏目 'child' => array ( 'where' => array ( 'auth_id' => array('1', '>='), 'state' => 1, ), 'type' => 'all', 'order' => array('id', 'desc'), 'col' => '*|auth_id|id|', ), ) );