| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 | <?php$level = function(){	$array = array();	$info = Dever::db('score/level')->state();	if($info)	{		$array += $info;	}	return $array;};$type = array(	1 => '自动升级',	2 => '手动升级',);return array(	# 表名	'name' => 'user_level',	# 显示给用户看的名称	'lang' => '用户积分等级',	'order' => 99,	'menu' => 'passport',	# 数据结构	'struct' => array	(		'id' 		=> array		(			'type' 		=> 'int-11',			'name' 		=> 'ID',			'default' 	=> '',			'desc' 		=> '',			'match' 	=> 'is_numeric',		),		'uid'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '用户名',			'default' 	=> '0',			'desc' 		=> '请选择用户',			'match' 	=> 'is_numeric',			//'update'	=> 'select',			//'search'	=> 'select',			'search'    => array            (                'api' => 'passport/user-all',                'col' => 'username',                'result' => 'id',            ),			'list'		=> '{uid} > 0 ? Dever::load("passport/user-one#username", {uid}) : "匿名用户"',		),		'level_id'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '等级名称',			'default' 	=> '1',			'desc' 		=> '等级名称',			'match' 	=> 'is_numeric',			'update'	=> 'select',			'option'	=> $level,			'search'	=> 'select',			'list'		=> true,			'edit'		=> true,		),		'type'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '升级方式',			'default' 	=> '1',			'desc' 		=> '升级方式',			'match' 	=> 'is_numeric',			'update'	=> 'select',			'option'	=> $type,			'search'	=> 'select',			'list'		=> true,			'edit'		=> true,		),		'info'      => array        (            'type'      => 'varchar-300',            'name'      => '备注',            'default'   => '',            'desc'      => '备注',            'match'     => 'option',            'update'    => 'textarea',            //'show'        => 'status=5'            'list'      => '"{info}" ? "{info}" : "双击添加备注"',            'edit'      => true,        ),		'cdate'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '录入时间',			'match' 	=> array('is_numeric', time()),			'desc' 		=> '',			# 只有insert时才生效			'insert'	=> true,		),	),	'manage' => array	(		'delete' => false,		'edit' => false,		'insert' => false,	),);
 |