one($id); $cate = Dever::db('collection/cate')->one($collection['cate_id']); } $type_default = 3; $type_config = Dever::db('collection/cate')->config['gettype']; if ($cate) { $type = array(); $cate_type = explode(',', $cate['type']); $i = 0; foreach ($cate_type as $k => $v) { if (isset($type_config[$v])) { if ($i == 0) { $type_default = $v; } $type[$v] = $type_config[$v]; $i++; } } } else { $type = $type_config; } return array ( # 表名 'name' => 'content', # 显示给用户看的名称 'lang' => '内容管理', 'menu' => false, 'gettype' => $type, 'end' => array ( 'insert' => 'collection/lib/manage.addContent', ), # 数据结构 'struct' => array ( 'id' => array ( 'type' => 'int-11', 'name' => 'ID', 'default' => '', 'desc' => '', 'match' => 'is_numeric', //'search' => 'order', //'list' => true, ), 'info_id' => array ( 'type' => 'int-11', 'name' => '合集', 'default' => '', 'desc' => '合集', 'match' => 'is_numeric', 'update' => 'hidden', 'value' => Dever::input('search_option_info_id') ), 'type' => array ( 'type' => 'varchar-150', 'name' => '类型', 'default' => $type_default, 'desc' => '类型', 'match' => 'is_numeric', 'update' => 'radio', 'option' => $type, ), 'type_id' => array ( 'type' => 'int-11', 'name' => '类型ID', 'default' => '', 'desc' => '类型ID', 'match' => 'is_numeric', ), 'name' => array ( 'type' => 'varchar-80', 'name' => '标题', 'default' => '', 'desc' => '标题', 'match' => 'is_string', 'update' => 'text', 'list' => true, //增加预览 'preview' => true, ), 'pic' => array ( 'type' => 'varchar-150', 'name' => '封面图-封面图尺寸375*693,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式', 'default' => '', 'desc' => '封面图', 'match' => 'option', 'update' => 'image', 'key' => '1', 'place' => '375*693', ), 'reorder' => array ( 'type' => 'int-11', 'name' => '页号', 'default' => '1', 'desc' => '请输入排序', 'match' => 'option', //'update' => 'text', 'search' => 'order', 'list' => true, 'order' => 'asc', '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 ( 'insert' => false, 'edit' => false, //'delete' => false, 'num' => false, 'page_list_table' => 'content', # 自定义快捷新增和编辑 'button' => array ( '新增内容' => array('location', 'add'), '预览' => array('fast', 'main/preview.get?type=4&id=' . Dever::input('search_option_info_id')), ), ), # request 请求接口定义 'request' => array ( 'getAllPage' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'info_id' => 'yes', 'state' => 1, ), 'type' => 'all', 'order' => array('reorder' => 'asc', 'id' => 'desc'), 'page' => array(10, 'list'), 'col' => '*', ), 'getAllByReorder' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'info_id' => 'yes', 'state' => 1, ), 'type' => 'one', 'order' => array('reorder' => 'desc', 'id' => 'desc'), 'col' => '*', ), ) );