relation.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <?php
  2. return array
  3. (
  4. # 表名
  5. 'name' => 'relation',
  6. # 显示给用户看的名称
  7. 'lang' => '邀请关系',
  8. # 是否显示在后台菜单
  9. 'order' => 9,
  10. 'menu' => false,
  11. # 数据结构
  12. 'struct' => array
  13. (
  14. 'id' => array
  15. (
  16. 'type' => 'int-11',
  17. 'name' => 'ID',
  18. 'default' => '',
  19. 'desc' => '',
  20. 'match' => 'is_numeric',
  21. //'list' => true,
  22. ),
  23. 'uid' => array
  24. (
  25. 'type' => 'int-11',
  26. 'name' => '邀请人',
  27. 'default' => '',
  28. 'desc' => '邀请人',
  29. 'match' => 'is_numeric',
  30. 'list' => true,
  31. ),
  32. 'to_uid' => array
  33. (
  34. 'type' => 'int-11',
  35. 'name' => '被邀请人',
  36. 'default' => '',
  37. 'desc' => '被邀请人',
  38. 'match' => 'is_numeric',
  39. 'list' => true,
  40. ),
  41. 'level' => array
  42. (
  43. 'type' => 'int-11',
  44. 'name' => '邀请级数',
  45. 'default' => '',
  46. 'desc' => '邀请级数',
  47. 'match' => 'is_numeric',
  48. 'list' => true,
  49. ),
  50. 'cdate' => array
  51. (
  52. 'type' => 'int-11',
  53. 'name' => '录入时间',
  54. 'match' => array('is_numeric', time()),
  55. 'desc' => '',
  56. # 只有insert时才生效
  57. 'insert' => true,
  58. 'search' => 'date',
  59. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  60. ),
  61. ),
  62. 'manage' => array
  63. (
  64. 'delete' => false,
  65. 'edit' => false,
  66. 'insert' => false,
  67. ),
  68. 'index' => array
  69. (
  70. 1 => array
  71. (
  72. 'uid' => 'uid,level',
  73. 'to_uid' => 'to_uid,level',
  74. ),
  75. # 版本号 更改版本号会更新当前表的索引
  76. 'version' => 1,
  77. ),
  78. 'request' => array
  79. (
  80. 'getChild' => array
  81. (
  82. # 匹配的正则或函数 选填项
  83. 'option' => array
  84. (
  85. 'uid' => 'yes',
  86. 'level' => array('yes', '<='),
  87. 'end' => array('yes-cdate', '<=')
  88. ),
  89. 'type' => 'all',
  90. 'order' => array('level' => 'asc','id' => 'desc'),
  91. 'col' => '*',
  92. ),
  93. 'getChildByPage' => array
  94. (
  95. # 匹配的正则或函数 选填项
  96. 'option' => array
  97. (
  98. 'uid' => 'yes',
  99. 'level' => array('yes', '<='),
  100. 'end' => array('yes-cdate', '<=')
  101. ),
  102. 'type' => 'all',
  103. 'order' => array('level' => 'asc','id' => 'desc'),
  104. 'page' => array(10, 'list'),
  105. 'col' => '*',
  106. ),
  107. 'getChildCount' => array
  108. (
  109. # 匹配的正则或函数 选填项
  110. 'option' => array
  111. (
  112. 'uid' => 'yes',
  113. 'level' => array('yes', '<='),
  114. 'end' => array('yes-cdate', '<=')
  115. ),
  116. 'type' => 'count',
  117. 'order' => array('id' => 'desc'),
  118. 'col' => '*',
  119. ),
  120. 'getParent' => array
  121. (
  122. # 匹配的正则或函数 选填项
  123. 'option' => array
  124. (
  125. 'to_uid' => 'yes',
  126. 'level' => array('yes', '<='),
  127. ),
  128. 'type' => 'all',
  129. 'order' => array('level' => 'asc', 'id' => 'desc'),
  130. 'col' => '*',
  131. ),
  132. 'getParent' => array
  133. (
  134. # 匹配的正则或函数 选填项
  135. 'option' => array
  136. (
  137. 'to_uid' => 'yes',
  138. 'level' => array('yes', '<='),
  139. ),
  140. 'type' => 'all',
  141. 'order' => array('level' => 'asc','id' => 'desc'),
  142. 'col' => '*',
  143. ),
  144. )
  145. );