| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246 | <?php$type = array(	# 小于10无需选项	1 => '单行输入框',	2 => '多行输入框',	3 => '单图片上传',	4 => '多图片上传',	# 大于10需要选项	11 => '城市选择框',	12 => '单选框',	13 => '多选框',);$must = array(	1 => '必填',	2 => '选填',);$content_type = array(	1 => '需要用户选择',	2 => '需要用户输入',);$match = array(	1 => '所有字符',	2 => '中文',	3 => '中文+英文',	4 => '中文+英文+数字',	5 => '英文',	6 => '英文+数字',	7 => '手机',	8 => '邮箱',);$id = Dever::input('search_option_product_id');$name = '';if ($id > 0) {	$info = Dever::db('service/product')->one($id);	$name = $info['name'] . '-';}return array(	# 表名	'name' => 'info',	# 显示给用户看的名称	'lang' => $name . '问卷管理',	'order' => 100,	'menu' => false,	# 数据结构	'struct' => array	(			'id' 		=> array		(			'type' 		=> 'int-11',			'name' 		=> 'ID',			'default' 	=> '',			'desc' 		=> '',			'match' 	=> 'is_numeric',			//'search'	=> 'order',			//'list'		=> true,		),		'page_number'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '页号',			'default' 	=> '1',			'desc' 		=> '请输入页号',			'match' 	=> 'option',			'update'	=> 'text',			'list'		=> true,			'order'		=> 'asc',			'edit'		=> true,		),		'reorder'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '序号',			'default' 	=> '1',			'desc' 		=> '请输入序号',			'match' 	=> 'option',			'update'	=> 'text',			'list'		=> true,			'order'		=> 'asc',			'edit'		=> true,		),		'name'		=> array		(			'type' 		=> 'varchar-200',			'name' 		=> '标题',			'default' 	=> '',			'desc' 		=> '标题',			'match' 	=> 'is_string',			'update'	=> 'text',			'search'	=> 'fulltext',			'list'		=> true,		),		'info'		=> array		(			'type' 		=> 'varchar-800',			'name' 		=> '描述',			'default' 	=> '',			'desc' 		=> '描述',			'match' 	=> 'option',			'update'	=> 'textarea',		),		'product_id'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '产品',			'default' 	=> '',			'desc' 		=> '产品',			'match' 	=> 'is_numeric',			'update'	=> 'hidden',			'value'		=> Dever::input('search_option_product_id')		),		'type'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '问卷类型',			'default' 	=> '1',			'desc' 		=> '问卷类型',			'match' 	=> 'is_numeric',			'option' 	=> $type,			'search'	=> 'select',			'update'	=> 'radio',			'list'		=> true,			'control'	=> 'type',		),		'must'		=> array		(			'type' 		=> 'tinyint-1',			'name' 		=> '是否必填',			'default' 	=> '1',			'desc' 		=> '是否必填',			'match' 	=> 'is_numeric',			'option' 	=> $must,			'update'	=> 'select',			'list'		=> true,			'edit'		=> true,		),		'match'		=> array		(			'type' 		=> 'tinyint-1',			'name' 		=> '验证规则',			'default' 	=> '1',			'desc' 		=> '验证规则',			'match' 	=> 'is_numeric',			'option' 	=> $match,			//'update'	=> 'select',			'show'		=> 'type=1,2',		),		'content'		=> array		(			'type' 		=> 'text-255',			'name' 		=> '选项设置',			'default' 	=> '',			'desc' 		=> '选项设置',			'match' 	=> 'is_string',			'show'		=> 'type=12,13',			'update'	=> array			(				array				(					'col'		=> 'score',					'name' 		=> '选项分数-用于计算最终结果,暂时可以不填',					'default' 	=> '0',					'desc' 		=> '选项分数',					'match' 	=> 'is_string',					'update'	=> 'text',				),				array				(					'col'		=> 'ctype',					'name' 		=> '选项类型',					'default' 	=> '1',					'desc' 		=> '选项类型',					'match' 	=> 'is_numeric',					'option' 	=> $content_type,					'update'	=> 'radio',					'control'	=> 'ctype',				),				array				(					'col'		=> 'title',					'name' 		=> '选项标题',					'default' 	=> '',					'desc' 		=> '请输入选项标题',					'match' 	=> 'option',					'update'	=> 'text',				),								array				(					'col'		=> 'pic',					'name' 		=> '选项图片',					'default' 	=> '',					'desc' 		=> '选项图片',					'match' 	=> 'option',					'update'	=> 'image',					'key' 		=> '1',					'show'		=> 'ctype=1',				),			),		),		'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,			'search'	=> 'date',			'list'		=> 'date("Y-m-d H:i:s", {cdate})',		),	),);
 |