audit; $table = Dever::config('base')->table; $table_name = Dever::config('base')->table_name; return array ( # 表名 'name' => 'moment', # 显示给用户看的名称 'lang' => '朋友圈管理', # 是否显示在后台菜单 'order' => 79, 'set' => array ( 'table' => $table, 'table_name' => $table_name, ), # 数据结构 'struct' => array ( 'id' => array ( 'type' => 'int-11', 'name' => 'ID', 'default' => '', 'desc' => '', 'match' => 'is_numeric', 'order' => 'desc', //'list' => true, ), 'uid' => array ( 'type' => 'int-11', 'name' => '用户名', 'default' => '0', 'desc' => '请选择用户', 'match' => 'is_numeric', //'update' => 'text', //'search' => 'select', 'search' => array ( 'api' => 'passport/user-all', 'col' => 'username', 'result' => 'id', ), 'list' => '{uid} > 0 ? Dever::load("passport/user-one#username", {uid}) : "匿名用户"', ), 'to_id' => array ( 'type' => 'int-11', 'name' => '引用的信息id', 'default' => '0', 'desc' => '引用的信息id', 'match' => 'is_numeric', //'update' => 'text', ), 'to_uid' => array ( 'type' => 'int-11', 'name' => '引用的信息所属uid', 'default' => '0', 'desc' => '引用的信息所属uid', 'match' => 'is_numeric', //'update' => 'text', ), 'type' => array ( 'type' => 'tinyint-1', 'name' => '所属数据源', 'default' => '', 'desc' => '所属数据源', 'match' => 'option', 'option' => $table, 'search' => 'select', //'update' => 'select', //'list' => true, ), 'type_id' => array ( 'type' => 'varchar-11', 'name' => '数据源id', 'default' => '', 'desc' => '数据源id', 'match' => 'option', //'update' => 'text', ), 'type_name' => array ( 'type' => 'varchar-200', 'name' => '数据源标题', 'default' => '', 'desc' => '数据源标题', 'match' => 'option', 'search' => 'fulltext', //'update' => 'text', //'list' => true, ), 'day' => array ( 'type' => 'int-11', 'name' => '日期', 'default' => '-1', 'desc' => '日期', 'match' => 'is_numeric', //'update' => 'text', ), 'num_up' => array ( 'type' => 'int-11', 'name' => '点赞数', 'default' => '0', 'desc' => '点赞数', 'match' => 'option', //'search' => 'order', //'list' => true, ), 'num_oppose' => array ( 'type' => 'int-11', 'name' => '反对数', 'default' => '0', 'desc' => '反对数', 'match' => 'option', //'search' => 'order', //'list' => true, ), 'num_comment' => array ( 'type' => 'int-11', 'name' => '评论数', 'default' => '0', 'desc' => '评论数', 'match' => 'option', //'search' => 'order', //'list' => true, ), 'pic' => array ( 'type' => 'text-255', 'name' => '图片-图片尺寸不等,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式', 'default' => '', 'desc' => '图片', 'match' => 'is_string', 'update' => 'images', 'key' => '1', ), 'content' => array ( 'type' => 'text-255', 'name' => '内容', 'update' => 'editor', 'key' => 1, 'default' => '', 'desc' => '请输入内容', 'match' => 'is_string', 'search' => 'fulltext', //'list' => true, //'modal' => '查看详情', 'list' => 'Dever::load("community/lib/info.content", "{id}")', ), 'audit' => array ( 'type' => 'int-11', 'name' => '审核', 'default' => '1', 'desc' => '审核', 'match' => 'is_numeric', //'update' => 'select', 'option' => $audit, //'search' => 'select', 'list' => true, '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})', ), ), # 索引 'index' => array ( # 索引名 => 索引id //'id' => 'id,state', 1 => array ( 'search' => 'type,type_id,day', ), 'version' => 1, ), 'manage' => array ( //'insert' => false, //'edit' => false, ), # request 请求接口定义 'request' => array ( 'getAll' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'uid' => 'yes', 'type' => 'yes', 'type_id' => 'yes', 'day' => 'yes', 'noid' => array('yes-id', '!='), 'audit' => 1, 'state' => 1, ), 'type' => 'all', 'order' => array('num_up`-`num_oppose' => 'desc', 'id' => 'desc'), 'page' => array(5, 'list'), 'col' => '*', ), 'getHot' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'uid' => 'yes', 'type' => 'yes', 'type_id' => 'yes', 'day' => 'yes', 'audit' => 1, 'state' => 1, ), 'type' => 'all', 'order' => array('num_up`-`num_oppose' => 'desc', 'id' => 'desc'), 'limit' => '0,1', 'col' => '*', ), 'getTotal' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'uid' => 'yes', 'type' => 'yes', 'type_id' => 'yes', 'day' => 'yes', 'audit' => 1, 'state' => 1, ), 'type' => 'count', ), ) );