| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244 | <?php$config = function(){	$array = array();	$info = Dever::db('score/config')->state();	if($info)	{		$array += $info;	}	return $array;};$action = function(){	$array = array();	$info = Dever::db('score/action')->state();	if($info)	{		$array += $info;	}	return $array;};$upper = array(	1 => '无上限',	2 => '有上限',);$upper_type = array(	1 => '按自然天-每天0点重置',	2 => '按小时',	3 => '永久',);$rebate_type = array(    1 => '无返利',    2 => '百分比',    3 => '数值',);$rebate_config = function(){	$array = array	(		-1 => array		(			'id' => -1,			'name' => '当前积分',		),	);	$info = Dever::db('score/config')->state();	if($info)	{		$array += $info;	}	return $array;};return array(	# 表名	'name' => 'rule',	# 显示给用户看的名称	'lang' => '积分规则设置',	'order' => 10,	'menu' => false,	# 数据结构	'struct' => array	(		'id' 		=> array		(			'type' 		=> 'int-11',			'name' 		=> 'ID',			'default' 	=> '',			'desc' 		=> '',			'match' 	=> 'is_numeric',		),				'config_id'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '积分名称',			'default' 	=> '1',			'desc' 		=> '积分名称',			'match' 	=> 'is_numeric',			'update'	=> 'select',			'option'	=> $config,			'search'	=> 'select',			'list'		=> true,			'value'     => Dever::input('search_option_config_id')		),		'action_id'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '所属行为',			'default' 	=> '1',			'desc' 		=> '所属行为',			'match' 	=> 'is_numeric',			'update'	=> 'select',			'option'	=> $action,			'search'	=> 'select',			'list'		=> true,		),		'num'		=> array		(			'type' 		=> 'varchar-80',			'name' 		=> '增加积分数-如果为负数,则是减少积分',			'default' 	=> '',			'desc' 		=> '增加积分数',			'match' 	=> 'option',			'update'	=> 'textarea',			'list'		=> true,		),		'num'		=> array		(			'type' 		=> 'varchar-80',			'name' 		=> '增加积分数-如果为负数,则是减少积分',			'default' 	=> '',			'desc' 		=> '增加积分数',			'match' 	=> 'option',			'update'	=> 'textarea',			'list'		=> true,		),		'upper'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '是否有上限限制',			'default' 	=> '1',			'desc' 		=> '是否有上限限制',			'match' 	=> 'is_numeric',			'update'	=> 'select',			'option'	=> $upper,			'search'	=> 'select',			'control'	=> 'upper',		),		'upper_type'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '上限限制类型',			'default' 	=> '1',			'desc' 		=> '上限限制类型',			'match' 	=> 'is_numeric',			'update'	=> 'select',			'option'	=> $upper_type,			'show'		=> 'upper=2',			'control'	=> 'upper_type',		),		'upper_time'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '间隔小时数',			'default' 	=> '12',			'desc' 		=> '间隔小时数',			'match' 	=> 'option',			'update'	=> 'text',			'show'		=> 'upper_type=2'		),		'upper_limit'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '上限限制次数-小于1则不限制',			'default' 	=> '2',			'desc' 		=> '上限限制次数',			'match' 	=> 'option',			'update'	=> 'text',			'show'		=> 'upper=2'		),		'rebate_type'      => array        (            'type'      => 'tinyint-1',            'name'      => '返利设置',            'default'   => '1',            'desc'      => '返利设置',            'match'     => 'option',            'update'    => 'radio',            'option'    => $rebate_type,            'list'      => true,            'search'    => 'select',            'control'	=> 'rebate_type',        ),        'rebate_config_id'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '返利积分名称',			'default' 	=> '-1',			'desc' 		=> '返利积分名称',			'match' 	=> 'is_numeric',			'update'	=> 'select',			'option'	=> $rebate_config,			'search'	=> 'select',			'list'		=> true,			'show'		=> 'rebate_type=2,3',		),                'rebate_value'     => array        (            'type'      => 'varchar-500',            'name'      => '返利积分数-如果是百分比类型,这里如果填的是10,那就是当前获得积分数的10%。直接填写数字就是当前用户的上级(1级)返利,支持多层层级设置,1:20,2:30 就是1级202级30,同时也支持0级',            'default'   => '',            'desc'      => '返利积分数',            'match'     => 'is_string',            'update'    => 'textarea',            'list'      => true,            'show'		=> 'rebate_type=2,3',        ),		'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,		),	),	'manage' => array	(			),);
 |