| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 | 
							- <?php
 
- $config = array
 
- (
 
- 	# 表名
 
- 	'name' => 'info_attr',
 
- 	# 显示给用户看的名称
 
- 	'lang' => '属性规格',
 
- 	'order' => 100,
 
- 	'menu' => false,
 
- 	# 数据结构 不同的字段放这里
 
- 	'struct' => array
 
- 	(
 
- 		'id' 		=> array
 
- 		(
 
- 			'type'      => 'int-11',
 
-             'name'      => 'ID',
 
-             'default'   => '',
 
-             'desc'      => '',
 
-             'match'     => 'is_numeric',
 
-             'search'    => 'order',
 
-             'order'		=> 'asc',
 
-             'update'    => 'hidden',
 
- 		),
 
- 		'info_id'      => array
 
-         (
 
-             'type'      => 'int-11',
 
-             'name'      => '商品',
 
-             'default'   => '',
 
-             'desc'      => '商品',
 
-             'match'     => 'is_numeric',
 
-             'update'    => 'hidden',
 
-             'value'     => Dever::input('search_option_info_id')
 
-         ),
 
-         'attr_id'      => array
 
-         (
 
-             'type'      => 'int-11',
 
-             'name'      => '属性id',
 
-             'default'   => '',
 
-             'desc'      => '属性id',
 
-             'match'     => 'is_numeric',
 
-         ),
 
-         'attr_value'      => array
 
-         (
 
-             'type'      => 'varchar-3000',
 
-             'name'      => '属性值',
 
-             'default'   => '',
 
-             'desc'      => '属性值',
 
-             'match'     => 'is_string',
 
-         ),
 
-         '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})',
 
- 		),
 
- 	),
 
- 	# 索引
 
- 	'index' => array
 
- 	(
 
- 		1 => array
 
- 		(
 
- 			'search' => 'info_id,attr_id,attr_value',
 
- 		),
 
- 		
 
- 		# 版本号 更改版本号会更新当前表的索引
 
- 		'version' => 1,
 
- 	),
 
- 	
 
- 	# 管理功能
 
- 	'manage' => array
 
- 	(
 
- 	),
 
- 	# request 请求接口定义
 
- 	'request' => array
 
- 	(
 
- 		# 分页
 
- 		'getPageAll' => array
 
- 		(
 
- 			# 匹配的正则或函数 选填项
 
- 			'option' => array
 
- 			(
 
- 				'audit' => array('yes-t_2.audit', 2),
 
- 				'category' => array('yes-t_2.category', 'like'),
 
- 				'top_category_id' => array('yes-t_2.top_category_id'),
 
- 				'second_category_id' => array('yes-t_2.second_category_id'),
 
- 				'category_id' => array('yes-t_2.category_id'),
 
- 				'state' => array('yes-t_2.state', 1),
 
- 			),
 
- 			# 联表
 
- 			'join' => array
 
- 			(
 
- 				array
 
- 				(
 
- 					'table' => 'res/info',
 
- 					'type' => 'left join',
 
- 					'on' => array('info_id','id'),
 
- 					'col' => 'info_id',
 
- 				),
 
- 			),
 
- 			'type' => 'all',
 
- 			'order' => array('t_1.id' => 'desc'),
 
- 			'page' => array(10, 'list'),
 
- 			'col' => '*',
 
- 		),
 
- 		'getDataByInfoId' => array
 
- 		(
 
- 			# 匹配的正则或函数 选填项
 
- 			'option' => array
 
- 			(
 
- 				'info_id' => 'yes',
 
- 				'state' => 1,
 
- 			),
 
- 			'type' => 'all',
 
- 			'order' => array('id' => 'desc'),
 
- 			'col' => '*|attr_id',
 
- 		),
 
- 	),
 
- );
 
- return $config;
 
 
  |