| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 | 
							- <?php
 
- /*
 
- |--------------------------------------------------------------------------
 
- | admin.php 管理员表
 
- |--------------------------------------------------------------------------
 
- */
 
- return array
 
- (
 
- 	# 表名
 
- 	'name' => 'admin_role',
 
- 	# 显示给用户看的名称
 
- 	'lang' => '管理员角色关联表',
 
- 	'menu' => false,
 
- 	# 数据结构
 
- 	'struct' => array
 
- 	(
 
- 		'id' 		=> array
 
- 		(
 
- 			'type' 		=> 'int-11',
 
- 			'name' 		=> 'ID',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '',
 
- 			'match' 	=> 'is_numeric',
 
- 			'search'	=> 'order',
 
- 			'list'		=> true,
 
- 		),
 
- 		
 
- 		'admin_id'		=> array
 
- 		(
 
- 			'type' 		=> 'int-11',
 
- 			'name' 		=> '管理员ID',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '管理员ID',
 
- 			'match' 	=> 'is_numeric',
 
- 			'update'	=> 'text',
 
- 			'list'		=> true,
 
- 		),
 
- 		'role_id'		=> array
 
- 		(
 
- 			'type' 		=> 'int-11',
 
- 			'name' 		=> '角色ID',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '角色ID',
 
- 			'match' 	=> 'is_numeric',
 
- 			'update'	=> 'text',
 
- 			'list'		=> true,
 
- 		),
 
- 		
 
- 		'cdate'		=> array
 
- 		(
 
- 			'type' 		=> 'int-11',
 
- 			'name' 		=> '录入时间',
 
- 			'match' 	=> array('is_numeric', DEVER_TIME),
 
- 			'desc' 		=> '',
 
- 			# 只有insert时才生效
 
- 			'insert'	=> true,
 
- 			'list'		=> 'date("Y-m-d H:i:s", {cdate})',
 
- 		),
 
- 	),
 
- 	# request 请求接口定义
 
- 	'request' => array
 
- 	(
 
- 		'*getTest' => array
 
- 		(
 
- 			'where' => array
 
- 			(
 
- 				'id' => 'yes',
 
- 			),
 
- 			'type' => 'one',
 
- 			#join为临时解决方案,不建议用join,建议用relate,join仅支持mysql
 
- 			
 
- 			# 联表
 
- 			'join' => array
 
- 			(
 
- 				array
 
- 				(
 
- 					'table' => 'manage/admin',
 
- 					'type' => 'left join',
 
- 					'on' => array('admin_id','id'),
 
- 					'col' => 'username',
 
- 				),
 
- 			),
 
- 			# 检索相关的数据
 
- 			'relate' => array
 
- 			(
 
- 				'manage/admin-one' => array
 
- 				(
 
- 					'option_id' => 'admin_id'
 
- 				),
 
- 			),
 
- 		),
 
- 		/*
 
- 		'getAll' => array
 
- 	    (
 
- 	        'where' => array
 
- 	        (
 
- 	            'config' => 'yes',
 
- 	            'state' => 1,
 
- 	            't_2.cate_id_in' => array('yes-t_2.cate_id', 'in'),
 
- 	            't_2.cate_id' => 'yes',
 
- 	        ),
 
- 	        'join' => array
 
- 				(
 
- 					array
 
- 					(
 
- 						'table' => 'service/company',
 
- 						'type' => 'left join',
 
- 						'on' => array('company_id','id'),
 
- 						'col' => 't_2.id as cid',
 
- 					),
 
- 				),
 
- 	        'type' => 'all',
 
- 	        'limit' => '0,5',
 
- 	        'order' => array('t_2.sdate' => 'desc','id' => 'desc'),
 
- 			'col' => 'id,t_1.name,t_1.content,t_2.name as company_name',
 
- 	    ),
 
- 		*/
 
- 		# query测试
 
- 		'*getTest1' => array
 
- 		(
 
- 			'query' => 'select * from {table} where id = ?',
 
- 			'type' => 'one',
 
- 		),
 
- 		'getData' => array
 
-         (
 
-             # 匹配的正则或函数 选填项
 
-             'option' => array
 
-             (
 
-                 'role_id' => array('yes', 'in'),
 
-             ),
 
-             'order' => array('id' => 'desc'),
 
-             'type' => 'all',
 
-             'col' => 'admin_id|admin_id',
 
-         ),
 
- 	)
 
- );
 
 
  |