'启用', 2 => '不启用', ); return array ( # 表名 'name' => 'info', # 显示给用户看的名称 'lang' => '分类列表', # 是否显示在后台菜单 'order' => 10, //'check' => 'key', 'end' => array ( 'insert' => 'category/lib/manage.update', 'update' => 'category/lib/manage.update', ), # 数据结构 'struct' => array ( 'id' => array ( 'type' => 'int-11', 'name' => 'ID', 'default' => '', 'desc' => '', 'match' => 'is_numeric', 'order' => 'asc', 'list' => true, ), 'name' => array ( 'type' => 'varchar-150', 'name' => '分类名称', 'default' => '', 'desc' => '分类名称', 'match' => 'is_string', 'update' => 'text', 'search' => 'fulltext', 'list' => true, 'edit' => true, ), 'key' => array ( 'type' => 'varchar-150', 'name' => '分类标识-请输入英文,分类标识为唯一项,用来区分前端展示,选填项', 'default' => '', 'desc' => '分类标识', 'match' => 'option', //'update' => 'text', //'search' => 'fulltext', //'list' => true, //'edit' => true, ), 'info' => array ( 'type' => 'varchar-800', 'name' => '上级分类', 'default' => Dever::input('option_info', -1), 'desc' => '请选择上级分类', 'match' => 'option', 'update' => 'linkage', 'linkage' => 'id=' . Dever::input('where_id'), 'option' => Dever::url('api.get', 'category'), //'list' => 'Dever::load("category/api.string", "{info}")', ), 'project_id' => array ( 'type' => 'int-11', 'name' => '所属项目', 'default' => Dever::input('option_project_id', 1), 'desc' => '所属项目', 'match' => 'is_numeric', 'update' => 'select', 'option' => $project, 'list' => '{project_id} > 0 ? Dever::load("category/project-one#name", {project_id}) : "未选择"', 'edit' => true, ), 'icon' => array ( 'type' => 'varchar-150', 'name' => '图标', 'default' => '', 'desc' => '图标', 'match' => 'option', 'update' => 'image', 'key' => 1, ), 'color' => array ( 'type' => 'varchar-10', 'name' => '字体颜色-请填写颜色代码', 'default' => '', 'desc' => '字体颜色', 'match' => 'option', 'update' => 'color', ), 'bgcolor' => array ( 'type' => 'varchar-10', 'name' => '背景颜色-请填写颜色代码', 'default' => '', 'desc' => '背景颜色', 'match' => 'option', 'update' => 'color', ), 'info_id' => array ( 'type' => 'int-11', 'name' => '上级分类', 'default' => -1, 'desc' => '请选择上级分类', 'match' => 'is_numeric', 'value' => Dever::input('option_info_id', -1), 'list' => '{info_id} > 0 ? Dever::load("category/info-one#name", {info_id}) : "父级分类"', ), 'top_id' => array ( 'type' => 'int-11', 'name' => '顶级分类', 'default' => -1, 'desc' => '请选择顶级分类', 'match' => 'is_numeric', ), 'level' => array ( 'type' => 'int-11', 'name' => '分类级别-1为顶级分类、2为2级分类,-1为最后一级分类', 'default' => 1, 'desc' => '分类级别', 'match' => 'is_numeric', ), 'status' => array ( 'type' => 'tinyint-1', 'name' => '是否启用', 'default' => '1', 'desc' => '是否启用', 'match' => 'is_numeric', //'update' => 'select', 'option' => $status, 'list' => true, 'edit' => true, ), 'reorder' => array ( 'type' => 'int-11', 'name' => '排序(数值越大越靠前)', 'default' => '1', 'desc' => '请输入排序', 'match' => 'option', //'update' => 'text', 'search' => 'order', 'list_name' => '排序', 'list' => true, 'order' => 'desc', 'edit' => true, ), 'state' => array ( 'type' => 'tinyint-1', 'name' => '状态', 'default' => '1', 'desc' => '请选择状态', 'match' => 'is_numeric', ), 'cdate' => array ( 'type' => 'int-11', 'name' => '录入时间', 'match' => array('is_numeric', time()), 'desc' => '', # 只有insert时才生效 'insert' => true, //'search' => 'date', //'list' => 'date("Y-m-d H:i:s", {cdate})', ), ), 'manage' => array ( 'button' => array ( '项目管理' => array('list', 'project&oper_parent=info&oper_project=category'), ), # 列表页的类型 'list_type' => 'tree', 'list_button' => array ( 'add' => array('新增子分类', '"{info}" == -1 ? "info&option_info={id}&option_project_id={project_id}" : "info&option_info={info},{id}&option_project_id={project_id}"'), ), ), 'request' => array ( # 获取顶级分类 'getTop' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'ids' => array('yes-id', 'in'), 'project_id' => 'yes', 'info_id' => -1, 'state' => 1, ), 'type' => 'all', 'order' => array('reorder' => 'desc', 'id' => 'asc'), 'col' => '*|id', ), 'getChild' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'project_id' => 'yes', 'info_id' => 'yes', 'top_id' => 'yes', 'level' => 'yes', 'info_id_in' => array('yes-info_id', 'in'), 'id' => array('yes', '!='), 'info' => array('yes', 'like'), 'state' => 1, ), 'type' => 'all', 'order' => array('reorder' => 'desc', 'id' => 'asc'), 'col' => '*|info_id|', ), 'getList' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'project_id' => 'yes', 'info_id' => 'yes', 'top_id' => 'yes', 'level' => 'yes', 'info_id_in' => array('yes-info_id', 'in'), 'id' => array('yes', '!='), 'info' => array('yes', 'like'), 'state' => 1, ), 'type' => 'all', 'order' => array('reorder' => 'desc', 'id' => 'asc'), 'col' => '*', ), 'getAll' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'project_id' => 'yes', 'info_id' => 'yes', 'id' => array('yes', '!='), 'state' => 1, ), 'type' => 'all', 'order' => array('reorder' => 'desc', 'id' => 'asc'), 'col' => 'id as value, name', ), ) );