ranking_data.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <?php
  2. $ranking_id = Dever::input('search_option_ranking_id');
  3. $periods = function() use($ranking_id)
  4. {
  5. $array = array();
  6. $info = Dever::db('collection/ranking_periods')->state(array('ranking_id' => $ranking_id));
  7. if($info)
  8. {
  9. $array += $info;
  10. }
  11. return $array;
  12. };
  13. return array
  14. (
  15. # 表名
  16. 'name' => 'ranking_data',
  17. # 显示给用户看的名称
  18. 'lang' => '榜单数据',
  19. 'menu' => false,
  20. 'check' => 'info_id,ranking_id,uid,periods_id',
  21. # 数据结构
  22. 'struct' => array
  23. (
  24. 'id' => array
  25. (
  26. 'type' => 'int-11',
  27. 'name' => 'ID',
  28. 'default' => '',
  29. 'desc' => '',
  30. 'match' => 'is_numeric',
  31. 'search' => 'order',
  32. 'update' => 'hidden',
  33. //'list' => true,
  34. ),
  35. 'info_id' => array
  36. (
  37. 'type' => 'int-11',
  38. 'name' => '合集',
  39. 'default' => '',
  40. 'desc' => '合集',
  41. 'match' => 'is_numeric',
  42. 'update' => 'hidden',
  43. 'value' => Dever::input('search_option_info_id')
  44. ),
  45. 'ranking_id' => array
  46. (
  47. 'type' => 'int-11',
  48. 'name' => '榜单id',
  49. 'default' => '',
  50. 'desc' => '榜单id',
  51. 'match' => 'is_numeric',
  52. 'update' => 'hidden',
  53. 'value' => Dever::input('search_option_ranking_id')
  54. ),
  55. 'uid' => array
  56. (
  57. 'type' => 'int-11',
  58. 'name' => '用户名',
  59. 'default' => '0',
  60. 'desc' => '请选择用户',
  61. 'match' => 'is_numeric',
  62. 'update' => 'text',
  63. //'search' => 'select',
  64. 'search' => array
  65. (
  66. 'api' => 'passport/user-all',
  67. 'col' => 'username',
  68. 'result' => 'id',
  69. ),
  70. 'list' => '{uid} > 0 ? Dever::load("passport/user-one#username", {uid}) : "匿名用户"',
  71. ),
  72. 'periods_id' => array
  73. (
  74. 'type' => 'int-11',
  75. 'name' => '期数',
  76. 'default' => '1',
  77. 'desc' => '期数',
  78. 'match' => 'is_numeric',
  79. 'update' => 'select',
  80. 'option' => $periods,
  81. 'search' => 'select',
  82. 'list' => true,
  83. ),
  84. 'num' => array
  85. (
  86. 'type' => 'int-11',
  87. 'name' => '榜单数据',
  88. 'default' => '0',
  89. 'desc' => '榜单数据',
  90. 'match' => 'is_numeric',
  91. 'update' => 'text',
  92. 'order' => 'desc',
  93. 'list' => '"{num}"',
  94. ),
  95. 'day' => array
  96. (
  97. 'type' => 'int-11',
  98. 'name' => '日期',
  99. 'default' => '',
  100. 'desc' => '日期',
  101. 'match' => 'is_numeric',
  102. 'update' => 'day',
  103. 'list' => true,
  104. ),
  105. 'state' => array
  106. (
  107. 'type' => 'tinyint-1',
  108. 'name' => '状态',
  109. 'default' => '1',
  110. 'desc' => '请选择状态',
  111. 'match' => 'is_numeric',
  112. ),
  113. 'cdate' => array
  114. (
  115. 'type' => 'int-11',
  116. 'name' => '创建时间',
  117. 'match' => array('is_numeric', time()),
  118. 'desc' => '',
  119. # 只有insert时才生效
  120. 'insert' => true,
  121. 'search' => 'date',
  122. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  123. ),
  124. ),
  125. 'manage' => array
  126. (
  127. //'insert' => false,
  128. 'delete' => false,
  129. ),
  130. 'request' => array
  131. (
  132. 'getAll' => array
  133. (
  134. # 匹配的正则或函数 选填项
  135. 'option' => array
  136. (
  137. 'info_id' => 'yes',
  138. 'ranking_id' => 'yes',
  139. 'periods_id' => 'yes',
  140. 'state' => 1,
  141. ),
  142. 'type' => 'all',
  143. 'order' => array('num' => 'desc', 'cdate' => 'desc'),
  144. 'limit' => '0,20',
  145. 'col' => '*',
  146. ),
  147. ),
  148. );