| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 | <?php# 定义几个常用的选项$option = array(	1 => '生效',	2 => '失效',);return array(	# 表名	'name' => 'auth',	# 显示给用户看的名称	'lang' => '功能权限设置',	'menu' => false,	# 数据结构	'struct' => array	(		'id' 		=> array		(			'type' 		=> 'int-11',			'name' 		=> 'ID',			'default' 	=> '',			'desc' 		=> '',			'match' 	=> 'is_numeric',			'order'		=> 'desc',		),		'project'		=> array		(			'type' 		=> 'varchar-50',			'name' 		=> '项目key',			'default' 	=> '',			'desc' 		=> '请输入项目key',			'match' 	=> 'is_string',			'update'	=> 'text',			'list'		=> true,		),		'project_name'		=> array		(			'type' 		=> 'varchar-50',			'name' 		=> '项目名',			'default' 	=> '',			'desc' 		=> '请输入项目名',			'match' 	=> 'is_string',			'update'	=> 'text',			'search'	=> 'order,fulltext',			'list'		=> true,		),				'name'		=> array		(			'type' 		=> 'varchar-50',			'name' 		=> '权限名',			'default' 	=> '',			'desc' 		=> '请输入权限名',			'match' 	=> 'is_string',			'update'	=> 'text',			'search'	=> 'order,fulltext',			'list'		=> true,		),				'auth_id'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '上级权限',			'default' 	=> '-1',			'desc' 		=> '请选择上级权限',			'match' 	=> 'is_numeric',			'update'	=> 'select',			'search'	=> 'order,select',			'list'		=> '{auth_id} > 0 ? Dever::load("manage/auth-one#name", {auth_id}) : "父级权限"',		),				'key'		=> array		(			'type' 		=> 'varchar-100',			'name' 		=> '权限key',			'default' 	=> '',			'desc' 		=> '请输入权限key',			'match' 	=> 'is_string',			'update'	=> 'text',			'search'	=> 'fulltext',			'list'		=> true,		),		'value'		=> array		(			'type' 		=> 'varchar-30',			'name' 		=> '对应的值',			'default' 	=> '',			'desc' 		=> '请输入对应的值',			'match' 	=> 'is_string',			'update'	=> 'text',			'search'	=> 'fulltext',			'list'		=> true,		),				'state'		=> array		(			'type' 		=> 'tinyint-1',			'name' 		=> '状态',			'default' 	=> '1',			'desc' 		=> '请选择状态',			'match' 	=> array('is_numeric', 1),			'option' 	=> $option,			'update'	=> 'radio',			'list'		=> true,		),				'cdate'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '录入时间',			'match' 	=> array('is_numeric', time()),			'desc' 		=> '',			# 只有insert时才生效			'insert'	=> true,			'list'		=> 'date("Y-m-d H:i:s", {cdate})',		),	),		# request 请求接口定义	'request' => array	(		'key' => array		(			'where' => array			(				'key' => 'yes',			),			'type' => 'one',		),		'project' => array		(			'where' => array			(				'state' => 1,			),			'type' => 'all',			'group' => 'project,project_name',			'col' => 'project,project_name',		),		# main 取所有主栏目		'main' => array		(			'where' => array			(				'auth_id' => -1,				'state' => 1,			),						'type' => 'all',			'order' => array('id', 'desc'),			'col' => '*|project|id|',		),				# 取所有下级栏目		'child' => array		(			'where' => array			(				'auth_id' => array('1', '>='),				'state' => 1,			),			'type' => 'all',			'order' => array('id', 'desc'),			'col' => '*|auth_id|id|',		),	));
 |