admin_role.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?php
  2. /*
  3. |--------------------------------------------------------------------------
  4. | admin.php 管理员表
  5. |--------------------------------------------------------------------------
  6. */
  7. return array
  8. (
  9. # 表名
  10. 'name' => 'admin_role',
  11. # 显示给用户看的名称
  12. 'lang' => '管理员角色关联表',
  13. 'menu' => false,
  14. # 数据结构
  15. 'struct' => array
  16. (
  17. 'id' => array
  18. (
  19. 'type' => 'int-11',
  20. 'name' => 'ID',
  21. 'default' => '',
  22. 'desc' => '',
  23. 'match' => 'is_numeric',
  24. 'search' => 'order',
  25. 'list' => true,
  26. ),
  27. 'admin_id' => array
  28. (
  29. 'type' => 'int-11',
  30. 'name' => '管理员ID',
  31. 'default' => '',
  32. 'desc' => '管理员ID',
  33. 'match' => 'is_numeric',
  34. 'update' => 'text',
  35. 'list' => true,
  36. ),
  37. 'role_id' => array
  38. (
  39. 'type' => 'int-11',
  40. 'name' => '角色ID',
  41. 'default' => '',
  42. 'desc' => '角色ID',
  43. 'match' => 'is_numeric',
  44. 'update' => 'text',
  45. 'list' => true,
  46. ),
  47. 'cdate' => array
  48. (
  49. 'type' => 'int-11',
  50. 'name' => '录入时间',
  51. 'match' => array('is_numeric', DEVER_TIME),
  52. 'desc' => '',
  53. # 只有insert时才生效
  54. 'insert' => true,
  55. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  56. ),
  57. ),
  58. # request 请求接口定义
  59. 'request' => array
  60. (
  61. '*getTest' => array
  62. (
  63. 'where' => array
  64. (
  65. 'id' => 'yes',
  66. ),
  67. 'type' => 'one',
  68. #join为临时解决方案,不建议用join,建议用relate,join仅支持mysql
  69. # 联表
  70. 'join' => array
  71. (
  72. array
  73. (
  74. 'table' => 'manage/admin',
  75. 'type' => 'left join',
  76. 'on' => array('admin_id','id'),
  77. 'col' => 'username',
  78. ),
  79. ),
  80. # 检索相关的数据
  81. 'relate' => array
  82. (
  83. 'manage/admin-one' => array
  84. (
  85. 'option_id' => 'admin_id'
  86. ),
  87. ),
  88. ),
  89. # query测试
  90. '*getTest1' => array
  91. (
  92. 'query' => 'select * from {table} where id = ?',
  93. 'type' => 'one',
  94. ),
  95. )
  96. );