<?php

$info = function()
{
	$array = array();
	$info = Dever::load('set/info-state');
	if($info)
	{
		$array += $info;
	}
	return $array;
};

$type = array(
	1 => '小程序',
	//2 => '微信公众号',
);

$sex = array(
	0 => '未知',
	1 => '男',
	2 => '女',
);

return array
(
	# 表名
	'name' => 'user',
	# 显示给用户看的名称
	'lang' => '用户管理',
	'order' => 99,
	# 数据结构
	'struct' => array
	(
		'id' 		=> array
		(
			'type' 		=> 'int-11',
			'name' 		=> '用户ID',
			'default' 	=> '',
			'desc' 		=> '',
			'match' 	=> 'is_numeric',
			//'search'	=> 'order',
			'order'		=> 'desc',
			'list'		=> true,
		),
		
		'name'		=> array
		(
			'type' 		=> 'varchar-60',
			'name' 		=> '用户昵称',
			'default' 	=> '',
			'desc' 		=> '请输入用户昵称',
			'match' 	=> 'is_string',
			'update'	=> 'text',
			'search'	=> 'fulltext',
			'list'		=> true,
		),

		'mobile'		=> array
		(
			'type' 		=> 'int-11',
			'name' 		=> '手机号',
			'default' 	=> '',
			'desc' 		=> '手机号',
			'match' 	=> 'is_numeric',
			'update'	=> 'text',
			'search'	=> 'fulltext',
			//'list'		=> true,
		),

		'pic'		=> array
		(
			'type' 		=> 'varchar-150',
			'name' 		=> '头像',
			'default' 	=> '',
			'desc' 		=> '请选择头像',
			'match' 	=> 'is_string',
			'update'	=> 'image',
			'key' 		=> '1',
			'place'		=> '150',
		),

		'type'		=> array
		(
			'type' 		=> 'int-11',
			'name' 		=> '用户来源',
			'default' 	=> '1',
			'desc' 		=> '请选择用户来源',
			'match' 	=> 'is_numeric',
			'update'	=> 'select',
			'option'	=> $type,
			'search'	=> 'select',
			'list'		=> true,
		),

		'sex'		=> array
		(
			'type' 		=> 'int-11',
			'name' 		=> '用户性别',
			'default' 	=> '1',
			'desc' 		=> '请选择用户性别',
			'match' 	=> 'is_numeric',
			'update'	=> 'select',
			'option'	=> $sex,
			'search'	=> 'select',
			'list'		=> true,
		),

		'city'		=> array
		(
			'type' 		=> 'varchar-200',
			'name' 		=> '城市',
			'default' 	=> '',
			'desc' 		=> '请输入用户城市',
			'match' 	=> 'is_string',
			'update'	=> 'text',
			//'search'	=> 'fulltext',
			'list'		=> true,
		),

		'province'		=> array
		(
			'type' 		=> 'varchar-200',
			'name' 		=> '省份',
			'default' 	=> '',
			'desc' 		=> '请输入用户身份',
			'match' 	=> 'is_string',
			'update'	=> 'text',
			//'search'	=> 'fulltext',
			'list'		=> true,
		),

		'country'		=> array
		(
			'type' 		=> 'varchar-200',
			'name' 		=> '国家',
			'default' 	=> '',
			'desc' 		=> '请输入用户国家',
			'match' 	=> 'is_string',
			'update'	=> 'text',
			//'search'	=> 'fulltext',
			//'list'		=> 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,
			'list'		=> 'date("Y-m-d H:i:s", {cdate})',
		),
	),
	
	'manage' => array
	(
		'insert' => false,
		'edit' => false,
		'delete' => false,
	),
	
	# request 请求接口定义
	'request' => array
	(
		
	),
);