| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211 | 
							- <?php
 
- $config = array
 
- (
 
- 	# 表名
 
- 	'name' => 'info_sku',
 
- 	# 显示给用户看的名称
 
- 	'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,
 
- 		),
 
- 		'key'		=> array
 
- 		(
 
- 			'type' 		=> 'varchar-100',
 
- 			'name' 		=> '属性标识',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '属性标识',
 
- 			'match' 	=> 'is_string',
 
- 			'update'	=> 'text',
 
- 		),
 
- 		'attr'		=> array
 
- 		(
 
- 			'type' 		=> 'text-255',
 
- 			'name' 		=> '属性组合规则',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '属性组合规则',
 
- 			'match' 	=> 'is_string',
 
- 			'update'	=> 'textarea',
 
- 			'list'		=> true,
 
- 		),
 
- 		'price'		=> array
 
- 		(
 
- 			'type' 		=> 'varchar-50',
 
- 			'name' 		=> '售价',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '售价',
 
- 			'match' 	=> 'is_string',
 
- 			'update'	=> 'text',
 
- 			'list'		=> true,
 
- 		),
 
- 		's_price'		=> array
 
- 		(
 
- 			'type' 		=> 'varchar-50',
 
- 			'name' 		=> '原价',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '原价',
 
- 			'match' 	=> 'is_string',
 
- 			'update'	=> 'text',
 
- 			'list'		=> true,
 
- 		),
 
- 		'num'		=> array
 
- 		(
 
- 			'type' 		=> 'int-11',
 
- 			'name' 		=> '库存',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '库存',
 
- 			'match' 	=> 'is_string',
 
- 			'update'	=> 'text',
 
- 			'list'		=> true,
 
- 		),
 
- 		'sell_num'		=> array
 
- 		(
 
- 			'type' 		=> 'int-11',
 
- 			'name' 		=> '销量',
 
- 			'default' 	=> '0',
 
- 			'desc' 		=> '请填写销量',
 
- 			'match' 	=> 'option',
 
- 			'search'	=> 'order',
 
- 			'list'		=> true,
 
- 		),
 
- 		'reorder'		=> array
 
- 		(
 
- 			'type' 		=> 'int-11',
 
- 			'name' 		=> '排序-数值越大越靠前,相当于置顶',
 
- 			'default' 	=> '1',
 
- 			'desc' 		=> '请输入排序',
 
- 			'match' 	=> 'option',
 
- 			//'update'	=> 'text',
 
- 			'search'	=> 'order',
 
- 			'list'		=> true,
 
- 			'order'		=> 'desc',
 
- 			'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})',
 
- 		),
 
- 	),
 
- 	'manage' => array
 
-     (
 
-         'insert' => false,
 
-         'edit' => false,
 
-         'delete' => false,
 
-         'num' => false,
 
-         'page_list_table' => 'sku',
 
-         # 自定义快捷新增和编辑
 
-         'button' => array
 
-         (
 
-             '自定义属性' => array('fast', 1, 'config&where_id=1'),
 
-         ),
 
-     ),
 
-     # request 请求接口定义
 
- 	'request' => array
 
- 	(
 
- 		# 列表
 
- 		'getData' => array
 
- 		(
 
- 			# 匹配的正则或函数 选填项
 
- 			'option' => array
 
- 			(
 
- 				'info_id' => 'yes',
 
- 				'state' => 1,
 
- 			),
 
- 			'type' => 'all',
 
- 			'order' => array('id' => 'desc'),
 
- 			'col' => '*|key',
 
- 		),
 
- 		'getMinOne' => array
 
- 		(
 
- 			# 匹配的正则或函数 选填项
 
- 			'option' => array
 
- 			(
 
- 				'info_id' => 'yes',
 
- 				'state' => 1,
 
- 			),
 
- 			'type' => 'one',
 
- 			'order' => array('price' => 'asc', 'id' => 'desc'),
 
- 			'col' => '*',
 
- 		),
 
- 		'getMaxOne' => array
 
- 		(
 
- 			# 匹配的正则或函数 选填项
 
- 			'option' => array
 
- 			(
 
- 				'info_id' => 'yes',
 
- 				'state' => 1,
 
- 			),
 
- 			'type' => 'one',
 
- 			'order' => array('price' => 'desc', 'id' => 'desc'),
 
- 			'col' => '*',
 
- 		),
 
- 		# 更新售出量
 
- 		'updateSell' => array
 
- 		(
 
- 			'type' => 'update',
 
- 			'where' => array
 
- 			(
 
- 				'id' => 'yes',
 
- 			),
 
- 			'set' => array
 
- 			(
 
- 				'sell_num' => array('yes', '+='),
 
- 			),
 
- 		),
 
- 	),
 
- );
 
- return $config;
 
 
  |