level.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <?php
  2. $config = function()
  3. {
  4. $array = array();
  5. $info = Dever::db('score/config')->state();
  6. if($info)
  7. {
  8. $array += $info;
  9. }
  10. return $array;
  11. };
  12. $type_id = function()
  13. {
  14. $array = array();
  15. $info = Dever::db('score/level_type')->state();
  16. if($info)
  17. {
  18. $array += $info;
  19. }
  20. return $array;
  21. };
  22. return array
  23. (
  24. # 表名
  25. 'name' => 'level',
  26. # 显示给用户看的名称
  27. 'lang' => '积分等级设置',
  28. # 后台菜单排序
  29. 'order' => 8,
  30. 'check' => 'level',
  31. 'desc' => '等级根据积分来升级,积分通过用户行为来生成,如果本项目有多个用户等级,如有声望等级、金币等级、普通用户等级、VIP用户等级,请设置等级类别,否则不需要设置',
  32. # 数据结构
  33. 'struct' => array
  34. (
  35. 'id' => array
  36. (
  37. 'type' => 'int-11',
  38. 'name' => 'ID',
  39. 'default' => '',
  40. 'desc' => '',
  41. 'match' => 'is_numeric',
  42. 'search' => 'order',
  43. //'list' => true,
  44. //'order' => 'desc',
  45. ),
  46. 'name' => array
  47. (
  48. 'type' => 'varchar-32',
  49. 'name' => '等级名称',
  50. 'default' => '',
  51. 'desc' => '请输入名称',
  52. 'match' => 'is_string',
  53. 'update' => 'text',
  54. 'search' => 'fulltext',
  55. 'list' => true,
  56. ),
  57. 'level_type_id' => array
  58. (
  59. 'type' => 'int-11',
  60. 'name' => '等级类别',
  61. 'default' => '1',
  62. 'desc' => '等级类别',
  63. 'match' => 'is_numeric',
  64. 'update' => 'select',
  65. 'option' => $type_id,
  66. 'search' => 'select',
  67. 'list' => true,
  68. ),
  69. 'score' => array
  70. (
  71. 'type' => 'text-1000',
  72. 'name' => '积分设置',
  73. 'default' => '',
  74. 'desc' => '积分设置',
  75. 'match' => 'is_string',
  76. 'update' => array
  77. (
  78. array
  79. (
  80. 'col' => 'config',
  81. 'name' => '积分名称',
  82. 'default' => '',
  83. 'desc' => '积分名称',
  84. 'match' => 'is_string',
  85. 'update' => 'select',
  86. 'option' => $config,
  87. ),
  88. array
  89. (
  90. 'col' => 'num',
  91. 'name' => '所需积分数',
  92. 'default' => '0',
  93. 'desc' => '所需积分数',
  94. 'match' => 'is_string',
  95. 'update' => 'text',
  96. ),
  97. ),
  98. ),
  99. 'level' => array
  100. (
  101. 'type' => 'int-11',
  102. 'name' => '等级数字-请直接输入等级数字,每次升级按照该数字进行匹配,如果设置为1,则为lv1,不允许重复',
  103. 'default' => '1',
  104. 'desc' => '等级数字',
  105. 'match' => 'option',
  106. 'update' => 'text',
  107. 'search' => 'order',
  108. 'list' => true,
  109. 'order' => 'desc',
  110. 'edit' => true,
  111. ),
  112. 'state' => array
  113. (
  114. 'type' => 'tinyint-1',
  115. 'name' => '状态',
  116. 'default' => '1',
  117. 'desc' => '请选择状态',
  118. 'match' => 'is_numeric',
  119. ),
  120. 'cdate' => array
  121. (
  122. 'type' => 'int-11',
  123. 'name' => '录入时间',
  124. 'match' => array('is_numeric', time()),
  125. 'desc' => '',
  126. # 只有insert时才生效
  127. 'insert' => true,
  128. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  129. ),
  130. ),
  131. 'manage' => array
  132. (
  133. # 自定义快捷新增和编辑
  134. 'button' => array
  135. (
  136. '等级类别' => array('list', 'level_type&project=score&oper_parent=level&oper_project=score'),
  137. ),
  138. ),
  139. 'request' => array
  140. (
  141. ),
  142. );