| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 | 
							- <?php
 
- # 定义几个常用的选项
 
- $type = array
 
- (
 
- 	1 => '固定值',
 
- 	2 => '自增值',
 
- 	3 => '公式算法',
 
- 	4 => '区间随机值',
 
- 	5 => '时间随机值',
 
- );
 
- return array
 
- (
 
- 	# 表名
 
- 	'name' => 'set',
 
- 	# 显示给用户看的名称
 
- 	'lang' => '自定义字段管理',
 
- 	'menu' => false,
 
- 	# 后台菜单排序
 
- 	'order' => 7,
 
- 	# 数据结构
 
- 	'struct' => array
 
- 	(
 
- 	
 
- 		'id' 		=> array
 
- 		(
 
- 			'type' 		=> 'int-11',
 
- 			'name' 		=> 'ID',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '',
 
- 			'match' 	=> 'is_numeric',
 
- 			'search'	=> 'order',
 
- 			'list'		=> true,
 
- 			'order'		=> 'desc',
 
- 		),
 
- 		'name'		=> array
 
- 		(
 
- 			'type' 		=> 'varchar-100',
 
- 			'name' 		=> '字段名称',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '字段名称',
 
- 			'match' 	=> 'is_string',
 
- 			'update'	=> 'text',
 
- 			'search'	=> 'fulltext',
 
- 			'list'		=> true,
 
- 			'edit'		=> true,
 
- 		),
 
- 		'key'		=> array
 
- 		(
 
- 			'type' 		=> 'varchar-100',
 
- 			'name' 		=> '字段唯一标识符',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '字段唯一标识符',
 
- 			'match' 	=> 'is_string',
 
- 			'update'	=> 'text',
 
- 			'search'	=> 'fulltext',
 
- 			'list'		=> true,
 
- 			'edit'		=> true,
 
- 		),
 
- 		'pid'		=> array
 
- 		(
 
- 			'type' 		=> 'int-11',
 
- 			'name' 		=> '项目id',
 
- 			'default' 	=> Dever::input('search_option_pid', -1),
 
- 			'desc' 		=> '请选择项目id',
 
- 			'match' 	=> 'is_numeric',
 
- 			'search'	=> 'order',
 
- 			'update'	=> 'hidden',
 
- 		),
 
- 		'type'		=> array
 
- 		(
 
- 			'type' 		=> 'tinyint-1',
 
- 			'name' 		=> '字段类型',
 
- 			'default' 	=> '1',
 
- 			'desc' 		=> '字段类型',
 
- 			'match' 	=> 'is_numeric',
 
- 			'option' 	=> $type,
 
- 			'update'	=> 'radio',
 
- 			'list'		=> true,
 
- 			'control'	=> 'type',
 
- 		),
 
- 		'value'		=> array
 
- 		(
 
- 			'type' 		=> 'varchar-2000',
 
- 			'name' 		=> '字段值-如果是区间随机值和时间随机值,第一行就是最小值,第二行就是最大值',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '字段值',
 
- 			'match' 	=> 'is_string',
 
- 			'update'	=> 'textarea',
 
- 			'list'		=> true,
 
- 			'edit'		=> 'textarea',
 
- 		),
 
- 		'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,
 
- 			'list'		=> 'date("Y-m-d H:i:s", {cdate})',
 
- 		),
 
- 	),
 
- 	'request' => array
 
- 	(
 
- 		'getList' => array
 
- 		(
 
- 			'where' => array
 
- 			(
 
- 				'pid' => 'yes',
 
- 				'state' => 1,
 
- 			),
 
- 			'type' => 'all',
 
- 			'order' => array
 
- 			(
 
- 				'id' => 'desc',
 
- 			),
 
- 			'col' => '*|key',
 
- 		),
 
- 	)
 
- );
 
 
  |