| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 | <?php/** * 上传表 * demo: data/upload/upload_name/10000/10/10.thumb_test.jpg * 基本操作:根据upload上传、保存到pic表,所有保存到pic表的图片,均可参与后续处理操作  */ # 定义几个常用的选项$option = array(	1 => '启用',	2 => '关闭',);return array(	# 表名	'name' => 'file',	# 显示给用户看的名称	'lang' => '文件管理',	'order' => 9,	# 数据结构	'struct' => array	(		'id' 		=> array		(			'type' 		=> 'int-11',			'name' 		=> 'ID',			'default' 	=> '',			'desc' 		=> '',			'match' 	=> 'is_numeric',			'search'	=> 'order',			//'list'		=> true,		),				'name'		=> array		(			'type' 		=> 'varchar-32',			'name' 		=> '文件名',			'default' 	=> '',			'desc' 		=> '请输入文件名',			'match' 	=> 'is_string',			'search'	=> 'fulltext',			'list'		=> true,		),		'source_name'		=> array		(			'type' 		=> 'varchar-50',			'name' 		=> '原文件名',			'default' 	=> '',			'desc' 		=> '请输入原文件名',			'match' 	=> 'is_string',			'search'	=> 'fulltext',			'list'		=> true,		),		'key'		=> array		(			'type' 		=> 'varchar-32',			'name' 		=> 'key',			'default' 	=> '',			'desc' 		=> 'key',			'match' 	=> 'is_string',			//'search'	=> 'fulltext',			//'list'		=> true,		),				'ext'		=> array		(			'type' 		=> 'varchar-24',			'name' 		=> '后缀名',			'default' 	=> '',			'desc' 		=> '请输入后缀名',			'match' 	=> 'is_string',			'list'		=> true,		),				'file'		=> array		(			'type' 		=> 'varchar-150',			'name' 		=> '访问路径',			'default' 	=> '',			'desc' 		=> '请输入访问路径',			'match' 	=> 'is_string',			'list'		=> true,		),				'width'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '宽度',			'default' 	=> '0',			'desc' 		=> '请输入宽度',			'match' 	=> 'option',			'list'		=> true,		),				'height'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '高度',			'default' 	=> '0',			'desc' 		=> '请输入高度',			'match' 	=> 'option',			'list'		=> true,		),				'size'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '大小',			'default' 	=> '0',			'desc' 		=> '请输入大小',			'match' 	=> 'option',			'list'		=> true,		),				'state'		=> array		(			'type' 		=> 'tinyint-1',			'name' 		=> '状态',			'default' 	=> '1',			'desc' 		=> '请选择状态',			'match' 	=> 'is_numeric',		),				'cdate'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '录入时间',			'match' 	=> array('is_numeric', time()),			'desc' 		=> '',			'list'		=> 'date("Y-m-d H:i:s", {cdate})',		),	),		# request 请求接口定义	'request' => array	(		# info 根据文件名获取数据		'file' => array		(			'where' => array			(				'file' => 'is_string',			),			'type' => 'one',		),				'name' => array		(			'where' => array			(				'name' => 'is_string',			),			'type' => 'one',		),	));
 |