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; } $id = Dever::input('where_id'); 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, 'order' => 'asc', ), 'info_id' => array ( 'type' => 'int-11', 'name' => '合集', 'default' => '', 'desc' => '合集', 'match' => 'is_numeric', 'update' => 'hidden', 'value' => Dever::input('search_option_info_id') ), 'source_id' => array ( 'type' => 'int-11', 'name' => '来源id-一般为采集器的采集规则id,用以区分导入的数据是否重复', 'default' => '-1', 'desc' => '来源id', 'match' => 'is_numeric', ), 'page_id' => array ( 'type' => 'int-11', 'name' => '章节', 'default' => '', 'desc' => '章节', 'match' => 'is_numeric', 'update' => 'hidden', 'value' => Dever::input('send_page_id') ), 'type' => array ( 'type' => 'varchar-150', 'name' => '类型', 'default' => $type_default, 'desc' => '类型', 'match' => 'is_numeric', 'update' => $id ? 'hidden' : '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' => '封面图-封面图尺寸300*300px,如果未上传,则自动使用内容中的图片,自动进行裁剪,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式', 'default' => '', 'desc' => '封面图', 'match' => 'option', 'update' => 'image', 'key' => '1', 'place' => '300*300', ), 'share_title' => array ( 'type' => 'varchar-100', 'name' => '分享标题-不填写将使用标题', 'default' => '', 'desc' => '分享标题', 'match' => 'option', 'update' => 'text', ), 'share_pic' => array ( 'type' => 'text-255', 'name' => '分享图片-图片尺寸300*300px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式,不传将使用封面图,这里可以上传多张,作为海报使用', 'default' => '', 'desc' => '分享图片', 'match' => 'option', 'update' => 'images', 'key' => '1', 'place' => '300*300', //'upload' => 'qiniu', //'large' => true, ), 'share_content' => array ( 'type' => 'varchar-200', 'name' => '分享内容', 'default' => '', 'desc' => '分享内容', 'match' => 'option', 'update' => 'textarea', ), 'copy_text' => array ( 'type' => 'text-255', 'name' => '复制文案', 'default' => '', 'desc' => '复制文案', 'match' => 'is_string', 'update' => array ( array ( 'col' => 'name', 'name' => '文字内容', 'default' => '', 'desc' => '文字内容', 'match' => 'is_string', 'update' => 'textarea', ), ), ), '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', 'page_id' => 'yes', 'state' => 1, ), 'type' => 'all', 'order' => array('reorder' => 'asc', 'id' => 'desc'), //'page' => array(30, 'list'), 'col' => 'id,type,name,pic,info_id,page_id', ), 'getAllByReorder' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'info_id' => 'yes', 'page_id' => 'yes', 'state' => 1, ), 'type' => 'one', 'order' => array('reorder' => 'asc', 'id' => 'desc'), 'col' => '*', ), 'child' => array ( 'option' => array ( 'state' => 1, 'page_id' => 'yes', 'info_id' => 'yes', 'type_id' => array(1, '>='), ), 'type' => 'all', 'order' => array('reorder' => 'asc', 'id' => 'desc'), 'col' => '*|page_id|', ), 'getNew' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'info_id' => 'yes', 'page_id' => 'yes', 'state' => 1, ), 'type' => 'one', 'order' => array('page_id' => 'desc','reorder' => 'desc', 'cdate' => 'desc'), 'col' => '*', ), ) );