123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- <?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-check' => array
- (
- 'where_id' => 'admin_id'
- ),
- ),
- ),
- # query测试
- '*getTest1' => array
- (
- 'query' => 'select * from {table} where id = ?',
- 'type' => 'one',
- ),
- )
- );
|