relation.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. 'request' => array
  69. (
  70. 'getChild' => array
  71. (
  72. # 匹配的正则或函数 选填项
  73. 'where' => array
  74. (
  75. 'uid' => 'yes',
  76. 'level' => array('yes', '<='),
  77. 'end' => array('yes-cdate', '<=')
  78. ),
  79. 'type' => 'all',
  80. 'order' => array('id' => 'desc'),
  81. 'col' => '*',
  82. ),
  83. 'getChildCount' => array
  84. (
  85. # 匹配的正则或函数 选填项
  86. 'where' => array
  87. (
  88. 'uid' => 'yes',
  89. 'level' => array('yes', '<='),
  90. 'end' => array('yes-cdate', '<=')
  91. ),
  92. 'type' => 'count',
  93. 'order' => array('id' => 'desc'),
  94. 'col' => '*',
  95. ),
  96. 'getParent' => array
  97. (
  98. # 匹配的正则或函数 选填项
  99. 'where' => array
  100. (
  101. 'to_uid' => 'yes',
  102. 'level' => array('yes', '<='),
  103. ),
  104. 'type' => 'all',
  105. 'order' => array('id' => 'desc'),
  106. 'col' => '*',
  107. ),
  108. )
  109. );