| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 | <?php$col = 'id,info_id,`key`,price,s_price,code';$config = array(	# 表名	'name' => 'info_spec',	# 显示给用户看的名称	'lang' => '商品规格设置',	'order' => 200,	'menu' => false,	# 数据结构 不同的字段放这里	'struct' => array	(		'id' 		=> array		(			'type' 		=> 'int-11',			'name' 		=> 'ID',			'default' 	=> '',			'desc' 		=> '',			'match' 	=> 'is_numeric',			//'list'		=> true,		),		'info_id'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '商品ID',			'default' 	=> '',			'desc' 		=> '商品ID',			'match' 	=> 'is_numeric',			'update'	=> 'text',			'list'		=> true,		),		'name'		=> array		(			'type' 		=> 'varchar-100',			'name' 		=> '规格名称',			'default' 	=> '',			'desc' 		=> '规格名称',			'match' 	=> 'is_string',			'update'	=> 'text',		),		'reorder'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '排序-数值越小越靠前',			'default' 	=> '1',			'desc' 		=> '请输入排序',			'match' 	=> 'option',			//'update'	=> 'text',			'search'	=> 'order',			'list'		=> true,			'order'		=> 'asc',			'edit'		=> 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' 		=> '',			# 只有insert时才生效			'insert'	=> true,			//'search'	=> 'date',			//'list'		=> 'date("Y-m-d H:i:s", {cdate})',		),	),	'index' => array    (        1 => array        (            # 索引名 => 索引id 如果有后缀.unique,则为建立索引的类型,如id,state.unique            'info' => 'info_id',        ),                # 版本号 更改版本号会更新当前表的索引        'version' => 1,    ),	'manage' => array    (        'insert' => false,        'edit' => false,        'delete' => false,        'num' => false,        # 自定义快捷新增和编辑        'button' => array        (            //'自定义属性' => array('fast', 1, 'config&where_id=1'),        ),    ),    # request 请求接口定义	'request' => array	(		# 列表		'getAll' => array		(			# 匹配的正则或函数 选填项			'option' => array			(				'info_id' => 'yes',				'state' => 1,			),			'type' => 'all',			'order' => array('reorder' => 'asc', 'id' => 'asc'),			'col' => 'id, name as title',		),		# 列表		'getData' => array		(			# 匹配的正则或函数 选填项			'option' => array			(				'info_id' => 'yes',				'state' => 1,			),			'type' => 'all',			'order' => array('reorder' => 'asc', 'id' => 'asc'),			'col' => 'id, name',		),	),);return $config;
 |