| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266 | <?php$type = array(	1 => '普通地址',	2 => '默认地址',);$sex = Dever::db('passport/user')->config['sex'];$tag = array(    1 => '公司',    2 => '家',    3 => '学校',    //4 => '其他',);return array(    # 表名    'name' => 'address',    # 显示给用户看的名称    'lang' => '用户地址库',    'end' => array	(		'insert' => 'passport/lib/manage.updateAddress',		'update' => 'passport/lib/manage.updateAddress',	),    'menu' => false,    # 数据结构    'struct' => array    (            'id'        => array        (            'type'      => 'int-11',            'name'      => 'ID',            'default'   => '',            'desc'      => '',            'match'     => 'is_numeric',            'search'    => 'order',            'update'    => 'hidden',            //'list'        => true,        ),        'uid'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '用户名',			'default' 	=> '0',			'desc' 		=> '请选择用户',			'match' 	=> 'is_numeric',			'update'	=> 'text',			//'search'	=> 'select',			'search'    => array            (                'api' => 'passport/user-all',                'col' => 'username',                'result' => 'id',            ),			'list'		=> '{uid} > 0 ? Dever::load("passport/user-one#username", {uid}) : "匿名用户"',		),		'type'		=> array		(			'type' 		=> 'tinyint-1',			'name' 		=> '类型',			'default' 	=> '2',			'desc' 		=> '类型',			'match' 	=> 'is_numeric',			'option' 	=> $type,			'update'	=> 'select',			//'list'		=> true,		),		'contact'		=> array		(			'type' 		=> 'varchar-100',			'name' 		=> '联系人',			'default' 	=> '',			'desc' 		=> '联系人',			'match' 	=> 'option',			'search'	=> 'fulltext',			'update'	=> 'text',			//'list'		=> true,		),        'sex'       => array        (            'type'      => 'tinyint-1',            'name'      => '性别',            'default'   => '3',            'desc'      => '性别',            'match'     => 'is_numeric',            'option'    => $sex,            'update'    => 'radio',            //'list'        => true,        ),		'mobile'		=> array		(			'type' 		=> 'varchar-100',			'name' 		=> '联系电话',			'default' 	=> '',			'desc' 		=> '联系电话',			'match' 	=> 'option',			'search'	=> 'fulltext',			'update'	=> 'text',			//'list'		=> true,		),        'country'		=> array		(			'type' 		=> 'varchar-100',			'name' 		=> '国家',			'default' 	=> '',			'desc' 		=> '国家',			'match' 	=> 'option',			//'update'	=> 'text',		),		'province'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '省份',			'default' 	=> '',			'desc' 		=> '省份',			'match' 	=> 'option',			//'update'	=> 'text',		),		'city'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '城市',			'default' 	=> '',			'desc' 		=> '城市',			'match' 	=> 'option',			//'update'	=> 'text',		),		'county'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '县区',			'default' 	=> '',			'desc' 		=> '县区',			'match' 	=> 'option',			//'update'	=> 'text',		),		'town'		=> array		(			'type' 		=> 'int-11',			'name' 		=> '街道',			'default' 	=> '',			'desc' 		=> '街道',			'match' 	=> 'option',			//'update'	=> 'text',		),		'area'		=> array		(			'type' 		=> 'varchar-800',			'name' 		=> '收货地址',			'default' 	=> '',			'desc' 		=> '收货地址',			'match' 	=> 'is_string',			'search'	=> 'linkage',			'update'	=> 'linkage',			'option'	=> Dever::url('api.get?level_total=4', 'area'),			'list'		=> 'Dever::load("area/api.string", "{area}")',		),		'address'		=> array		(			'type' 		=> 'varchar-1000',			'name' 		=> '详细地址',			'default' 	=> '',			'desc' 		=> '详细地址',			'match' 	=> 'option',			//'update'	=> 'text',			//'list'		=> true,		),        'house_number'       => array        (            'type'      => 'varchar-500',            'name'      => '门牌号',            'default'   => '',            'desc'      => '门牌号',            'match'     => 'option',            'update'  => 'text',            //'list'        => true,        ),        'tag'      => array        (            'type'      => 'tinyint-1',            'name'      => '标签',            'default'   => '1',            'desc'      => '标签',            'match'     => 'is_numeric',            'option'    => $tag,            'update'    => 'radio',            //'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,            'search'    => 'date',            'list'      => 'date("Y-m-d H:i:s", {cdate})',        ),    ),    'manage' => array    (            ),    'request' => array    (		'getList' => array		(			# 匹配的正则或函数 选填项			'option' => array			(				'uid' => 'yes',				'state' => 1,			),			'type' => 'all',			'order' => array('type' => 'desc','id' => 'desc'),			'page' => array(10, 'list'),			'col' => '*',		),        'updateType' => array        (            'set' => array            (                'type' => 'yes',            ),            'where' => array            (                'type' => 'yes',            ),            'type' => 'update',        ),    ),);
 |