| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 | 
							- <?php
 
- $option = array
 
- (
 
- 	1 => '选中',
 
- 	2 => '未选中',
 
- );
 
- $config = array
 
- (
 
- 	# 表名
 
- 	'name' => 'info_spec_value',
 
- 	# 显示给用户看的名称
 
- 	'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,
 
- 		),
 
- 		'spec_id'		=> array
 
- 		(
 
- 			'type' 		=> 'int-11',
 
- 			'name' 		=> '规格ID',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '规格ID',
 
- 			'match' 	=> 'is_numeric',
 
- 			'update'	=> 'text',
 
- 			'list'		=> true,
 
- 		),
 
- 		'value'		=> array
 
- 		(
 
- 			'type' 		=> 'varchar-500',
 
- 			'name' 		=> '规格值',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '规格值',
 
- 			'match' 	=> 'is_string',
 
- 			'update'	=> 'text',
 
- 		),
 
- 		'is_checked'		=> array
 
- 		(
 
- 			'type' 		=> 'tinyint-1',
 
- 			'name' 		=> '是否选中',
 
- 			'default' 	=> '1',
 
- 			'desc' 		=> '是否选中',
 
- 			'match' 	=> 'is_numeric',
 
- 			'update'	=> 'radio',
 
- 			'option'	=> $option,
 
- 		),
 
- 		'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',
 
- 				'spec_id' => 'yes',
 
- 				'state' => 1,
 
- 			),
 
- 			'type' => 'all',
 
- 			'order' => array('reorder' => 'asc', 'id' => 'asc'),
 
- 			'col' => 'id, value as title, case is_checked when 1 then true else false end as checked',
 
- 		),
 
- 		'getGroupData' => array
 
-         (
 
-             # 匹配的正则或函数 选填项
 
-             'option' => array
 
-             (
 
-                 'info_id' => 'yes',
 
-                 'ids' => array('yes-id', 'in'),
 
-                 'state' => 1,
 
-             ),
 
-             'type' => 'one',
 
-             'group' => 'info_id',
 
-             'order' => array('reorder' => 'desc', 'id' => 'desc'),
 
-             'col' => 'id,info_id,value,group_concat(value) as name',
 
-         ),
 
-         'getData' => array
 
-         (
 
-             # 匹配的正则或函数 选填项
 
-             'option' => array
 
-             (
 
-                 'info_id' => 'yes',
 
-                 'spec_id' => 'yes',
 
-                 'state' => 1,
 
-             ),
 
-             'type' => 'all',
 
-             'order' => array('reorder' => 'desc', 'id' => 'desc'),
 
-             'col' => 'id,value as name',
 
-         ),
 
- 	),
 
- );
 
- return $config;
 
 
  |