ranking.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <?php
  2. return array
  3. (
  4. # 表名
  5. 'name' => 'ranking',
  6. # 显示给用户看的名称
  7. 'lang' => '积分榜单',
  8. # 是否显示在后台菜单
  9. 'order' => 1,
  10. # 数据结构
  11. 'struct' => array
  12. (
  13. 'id' => array
  14. (
  15. 'type' => 'int-11',
  16. 'name' => 'ID',
  17. 'default' => '',
  18. 'desc' => '',
  19. 'match' => 'is_numeric',
  20. //'order' => 'desc',
  21. 'list_name' => '排名',
  22. 'list' => '{r}',
  23. ),
  24. 'user_id' => array
  25. (
  26. 'type' => 'int-11',
  27. 'name' => '用户参与id',
  28. 'default' => '',
  29. 'desc' => '用户参与id',
  30. 'match' => 'is_numeric',
  31. //'list' => true,
  32. ),
  33. /*
  34. 'exam_id' => array
  35. (
  36. 'type' => 'int-11',
  37. 'name' => '活动',
  38. 'default' => '1',
  39. 'desc' => '活动id',
  40. 'match' => 'is_numeric',
  41. 'list' => '{exam_id} > 0 ? Dever::load("question/exam-one#name", {exam_id}) : "未知"',
  42. ),
  43. */
  44. 'uid' => array
  45. (
  46. 'type' => 'int-11',
  47. 'name' => '用户',
  48. 'default' => '',
  49. 'desc' => '用户',
  50. 'match' => 'is_numeric',
  51. 'list' => '{uid} > 0 ? Dever::load("passport/user-one#name", {uid}) : "匿名用户"',
  52. ),
  53. 'score' => array
  54. (
  55. 'type' => 'int-11',
  56. 'name' => '本次分数',
  57. 'default' => '0',
  58. 'desc' => '本次分数',
  59. 'match' => 'is_numeric',
  60. 'update' => 'text',
  61. //'search' => 'order',
  62. 'order' => 'desc',
  63. 'list' => true,
  64. ),
  65. 'times' => array
  66. (
  67. 'type' => 'int-11',
  68. 'name' => '答题次数',
  69. 'default' => '0',
  70. 'desc' => '答题次数',
  71. 'match' => 'is_string',
  72. 'update' => 'text',
  73. 'list' => true,
  74. ),
  75. 'state' => array
  76. (
  77. 'type' => 'tinyint-1',
  78. 'name' => '状态',
  79. 'default' => '1',
  80. 'desc' => '请选择状态',
  81. 'match' => 'is_numeric',
  82. ),
  83. 'cdate' => array
  84. (
  85. 'type' => 'int-11',
  86. 'name' => '录入时间',
  87. 'match' => array('is_numeric', time()),
  88. 'desc' => '',
  89. 'search' => 'date',
  90. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  91. ),
  92. ),
  93. 'manage' => array
  94. (
  95. //'insert' => false,
  96. 'edit' => false,
  97. 'delete' => false,
  98. ),
  99. 'request' => array
  100. (
  101. # 获取最新一条的用户信息
  102. 'getTotal' => array
  103. (
  104. # 匹配的正则或函数 选填项
  105. 'option' => array
  106. (
  107. 'exam_id' => 'yes',
  108. 'score' => array('yes', '<'),
  109. 'state' => 1,
  110. ),
  111. 'type' => 'count',
  112. ),
  113. )
  114. );