| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 | <?phpreturn array(	# 表名	'name' => 'relation',	# 显示给用户看的名称	'lang' => '邀请关系',	# 是否显示在后台菜单	'order' => 9,	'menu'	=> false,	# 数据结构	'struct' => array	(		'id' 		=> array		(			'type' 		=> 'int-11',			'name' 		=> 'ID',			'default' 	=> '',			'desc' 		=> '',			'match' 	=> 'is_numeric',			//'list'		=> true,		),		'uid' 		=> array		(			'type' 		=> 'int-11',			'name' 		=> '邀请人',			'default' 	=> '',			'desc' 		=> '邀请人',			'match' 	=> 'is_numeric',			'list'		=> true,		),		'to_uid' 		=> array		(			'type' 		=> 'int-11',			'name' 		=> '被邀请人',			'default' 	=> '',			'desc' 		=> '被邀请人',			'match' 	=> 'is_numeric',			'list'		=> true,		),		'level' 		=> array		(			'type' 		=> 'int-11',			'name' 		=> '邀请级数',			'default' 	=> '',			'desc' 		=> '邀请级数',			'match' 	=> 'is_numeric',			'list'		=> true,		),				'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	(		'delete' => false,		'edit' => false,		'insert' => false,	),	'index' => array	(		1 => array		(			'uid' => 'uid,level',			'to_uid' => 'to_uid,level',		),				# 版本号 更改版本号会更新当前表的索引		'version' => 1,	),	'request' => array	(		'getChild' => array		(			# 匹配的正则或函数 选填项			'option' => array			(				'uid' => 'yes',				'level' => array('yes', '<='),				'end' => array('yes-cdate', '<=')			),			'type' => 'all',			//'order' => array('level' => 'asc','id' => 'desc'),            'group' => 'to_uid',			'order' => array('cdate' => 'desc'),			'col' => '*|to_uid',		),		'getChildByPage' => array		(			# 匹配的正则或函数 选填项			'option' => array			(				'uid' => 'yes',				'level' => array('yes', '<='),				'end' => array('yes-cdate', '<=')			),			'type' => 'all',			//'order' => array('level' => 'asc','id' => 'desc'),			'order' => array('cdate' => 'desc'),            'group' => 'to_uid',			'page' => array(10, 'list'),			'col' => '*',		),		'getChildCount' => array		(			# 匹配的正则或函数 选填项			'option' => array			(				'uid' => 'yes',				'level' => array('yes', '<='),				'start' => array('yes-cdate', '>='),				'end' => array('yes-cdate', '<='),			),			'type' => 'count',			'order' => array('id' => 'desc'),			'col' => '*',		),		'getParent' => array		(			# 匹配的正则或函数 选填项			'option' => array			(				'to_uid' => 'yes',				'level' => array('yes', '<='),			),			'type' => 'all',			'order' => array('level' => 'asc','id' => 'desc'),			'col' => '*',		),		'getParentLevel' => array		(			# 匹配的正则或函数 选填项			'option' => array			(				'to_uid' => 'yes',				'level' => array('yes', '<='),			),			'type' => 'all',			'order' => array('level' => 'desc', 'id' => 'desc'),			'col' => '*',		),	));
 |