| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 | 
							- <?php
 
- # 定义几个常用的选项
 
- $type = array
 
- (
 
- 	1 => '未领取',
 
- 	2 => '已领取',
 
- 	3 => '已使用',
 
- );
 
- $product = function()
 
- {
 
- 	return Dever::db('product/info')->state();
 
- };
 
- /*
 
- $product_price = function()
 
- {
 
- 	return Dever::db('product/info_price')->state();
 
- };
 
- */
 
- return array
 
- (
 
- 	# 表名
 
- 	'name' => 'info',
 
- 	# 显示给用户看的名称
 
- 	'lang' => '兑换码列表',
 
- 	'order' => 10,
 
- 	# 数据结构
 
- 	'struct' => array
 
- 	(
 
- 	
 
- 		'id' 		=> array
 
- 		(
 
- 			'type' 		=> 'int-11',
 
- 			'name' 		=> 'ID',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '',
 
- 			'match' 	=> 'is_numeric',
 
- 			'search'	=> 'order',
 
- 			//'list'		=> true,
 
- 		),
 
- 		'product_id'		=> array
 
- 		(
 
- 			'type' 		=> 'int-11',
 
- 			'name' 		=> '产品',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '产品',
 
- 			'match' 	=> 'is_numeric',
 
- 			'update'	=> 'select',
 
- 			'option'	=> $product,
 
- 			'search'	=> 'select',
 
- 			'list'		=> true,
 
- 		),
 
- 		'product_price_id'		=> array
 
- 		(
 
- 			'type' 		=> 'int-11',
 
- 			'name' 		=> '产品规格',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '产品规格',
 
- 			'match' 	=> 'is_numeric',
 
- 			'update'	=> 'select',
 
- 			//'option'	=> $product_price,
 
- 			'search'	=> 'select',
 
- 			//'list'		=> true,
 
- 		),
 
- 		'code'		=> array
 
- 		(
 
- 			'type' 		=> 'varchar-32',
 
- 			'name' 		=> '兑换码',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '兑换码',
 
- 			'match' 	=> 'is_string',
 
- 			'update'	=> 'text',
 
- 			//'search'	=> 'fulltext',
 
- 			'list'		=> true,
 
- 		),
 
- 		'type'		=> array
 
- 		(
 
- 			'type' 		=> 'int-11',
 
- 			'name' 		=> '使用状态',
 
- 			'default' 	=> '1',
 
- 			'desc' 		=> '使用状态',
 
- 			'match' 	=> 'is_numeric',
 
- 			'option' 	=> $type,
 
- 			'search'	=> 'select',
 
- 			'update'	=> 'select',
 
- 			'list'		=> true,
 
- 		),
 
- 		'uid'		=> array
 
- 		(
 
- 			'type' 		=> 'int-11',
 
- 			'name' 		=> '用户信息',
 
- 			'default' 	=> '0',
 
- 			'desc' 		=> '用户信息',
 
- 			'match' 	=> 'is_numeric',
 
- 			'list'		=> 'Dever::load("code/lib/manage.showUserInfo", "{uid}", "{ldate}")',
 
- 		),
 
- 		'state'		=> array
 
- 		(
 
- 			'type' 		=> 'tinyint-1',
 
- 			'name' 		=> '状态',
 
- 			'default' 	=> '1',
 
- 			'desc' 		=> '请选择状态',
 
- 			'match' 	=> 'is_numeric',
 
- 		),
 
- 		'ldate'		=> array
 
- 		(
 
- 			'type' 		=> 'int-11',
 
- 			'name' 		=> '领取时间',
 
- 			'match' 	=> 'option',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '',
 
- 			'search'	=> 'date',
 
- 		),
 
- 		
 
- 		'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
 
- 	(
 
- 		'excel'	=> true,
 
- 		'delete' => false,
 
- 		'edit' => false,
 
- 		'insert' => false,
 
- 	),
 
- );
 
 
  |