relation.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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. 'group' => 'to_uid',
  92. 'order' => array('cdate' => 'desc'),
  93. 'col' => '*|to_uid',
  94. ),
  95. 'getChildByPage' => array
  96. (
  97. # 匹配的正则或函数 选填项
  98. 'option' => array
  99. (
  100. 'uid' => 'yes',
  101. 'level' => array('yes', '<='),
  102. 'end' => array('yes-cdate', '<=')
  103. ),
  104. 'type' => 'all',
  105. //'order' => array('level' => 'asc','id' => 'desc'),
  106. 'order' => array('cdate' => 'desc'),
  107. 'group' => 'to_uid',
  108. 'page' => array(10, 'list'),
  109. 'col' => '*',
  110. ),
  111. 'getChildCount' => array
  112. (
  113. # 匹配的正则或函数 选填项
  114. 'option' => array
  115. (
  116. 'uid' => 'yes',
  117. 'level' => array('yes', '<='),
  118. 'start' => array('yes-cdate', '>='),
  119. 'end' => array('yes-cdate', '<='),
  120. ),
  121. 'type' => 'count',
  122. 'order' => array('id' => 'desc'),
  123. 'col' => '*',
  124. ),
  125. 'getParent' => array
  126. (
  127. # 匹配的正则或函数 选填项
  128. 'option' => array
  129. (
  130. 'to_uid' => 'yes',
  131. 'level' => array('yes', '<='),
  132. ),
  133. 'type' => 'all',
  134. 'order' => array('level' => 'asc','id' => 'desc'),
  135. 'col' => '*',
  136. ),
  137. 'getParentLevel' => array
  138. (
  139. # 匹配的正则或函数 选填项
  140. 'option' => array
  141. (
  142. 'to_uid' => 'yes',
  143. 'level' => array('yes', '<='),
  144. ),
  145. 'type' => 'all',
  146. 'order' => array('level' => 'desc', 'id' => 'desc'),
  147. 'col' => '*',
  148. ),
  149. )
  150. );