123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311 |
- <?php
- $audit = Dever::config('base')->audit;
- $table = Dever::config('base')->table;
- $table_name = Dever::config('base')->table_name;
- $cate = function()
- {
- $array = array();
- $info = Dever::load('attr/cate-state');
- if($info)
- {
- $array += $info;
- }
- return $array;
- };
- return array
- (
- # 表名
- 'name' => 'info',
- # 显示给用户看的名称
- 'lang' => '社区信息管理',
- # 是否显示在后台菜单
- 'order' => 80,
- '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',
- ),
- 'cate_id' => array
- (
- 'type' => 'int-11',
- 'name' => '所属类别',
- 'default' => '1',
- 'desc' => '所属类别',
- 'match' => 'is_numeric',
- //'update' => 'select',
- 'option' => $cate,
- //'list' => '{cate_id} > 0 ? Dever::load("attr/cate-one#name", {cate_id}) : "未选择"',
- ),
- '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' => 'cate_id,type,type_id,day',
- ),
- 'version' => 1,
- ),
- 'manage' => array
- (
- //'insert' => false,
- //'edit' => false,
- ),
- # request 请求接口定义
- 'request' => array
- (
- 'getAll' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'uid' => 'yes',
- 'cate_id' => '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',
- 'cate_id' => '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',
- 'cate_id' => 'yes',
- 'type' => 'yes',
- 'type_id' => 'yes',
- 'day' => 'yes',
- 'audit' => 1,
- 'state' => 1,
- ),
- 'type' => 'count',
- ),
- )
- );
|