ranking_vote.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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_vote_data',
  17. # 显示给用户看的名称
  18. 'lang' => '榜单投票设置',
  19. 'menu' => false,
  20. 'check' => 'info_id,ranking_id,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. 'periods_id' => array
  56. (
  57. 'type' => 'int-11',
  58. 'name' => '期数',
  59. 'default' => '1',
  60. 'desc' => '期数',
  61. 'match' => 'is_numeric',
  62. 'update' => 'select',
  63. 'option' => $periods,
  64. 'search' => 'select',
  65. 'list' => true,
  66. ),
  67. 'name' => array
  68. (
  69. 'type' => 'varchar-32',
  70. 'name' => '名称',
  71. 'default' => '',
  72. 'desc' => '名称',
  73. 'match' => 'is_string',
  74. 'update' => 'text',
  75. 'search' => 'fulltext',
  76. 'list' => true,
  77. ),
  78. 'logo' => array
  79. (
  80. 'type' => 'varchar-150',
  81. 'name' => 'LOGO图片-图片尺寸150*150px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  82. 'default' => '',
  83. 'desc' => 'LOGO图片',
  84. 'match' => 'option',
  85. 'update' => 'image',
  86. 'key' => '1',
  87. 'place' => '150*150',
  88. ),
  89. 'num' => array
  90. (
  91. 'type' => 'int-11',
  92. 'name' => '票数',
  93. 'default' => '0',
  94. 'desc' => '票数',
  95. 'match' => 'is_numeric',
  96. //'update' => 'text',
  97. 'order' => 'desc',
  98. 'list' => '"{num}"',
  99. ),
  100. 'num_add' => array
  101. (
  102. 'type' => 'int-11',
  103. 'name' => '票数基数',
  104. 'default' => '0',
  105. 'desc' => '手动增加票数基数',
  106. 'match' => 'option',
  107. //'update' => 'text',
  108. ),
  109. 'state' => array
  110. (
  111. 'type' => 'tinyint-1',
  112. 'name' => '状态',
  113. 'default' => '1',
  114. 'desc' => '请选择状态',
  115. 'match' => 'is_numeric',
  116. ),
  117. 'cdate' => array
  118. (
  119. 'type' => 'int-11',
  120. 'name' => '创建时间',
  121. 'match' => array('is_numeric', time()),
  122. 'desc' => '',
  123. # 只有insert时才生效
  124. 'insert' => true,
  125. 'search' => 'date',
  126. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  127. ),
  128. ),
  129. 'manage' => array
  130. (
  131. //'insert' => false,
  132. //'delete' => false,
  133. ),
  134. 'request' => array
  135. (
  136. 'getAll' => array
  137. (
  138. # 匹配的正则或函数 选填项
  139. 'option' => array
  140. (
  141. 'uid' => 'yes',
  142. 'info_id' => 'yes',
  143. 'ranking_id' => 'yes',
  144. 'periods_id' => 'yes',
  145. 'state' => 1,
  146. ),
  147. 'type' => 'all',
  148. 'order' => array('num' => 'desc', 'cdate' => 'desc'),
  149. 'limit' => '0,20',
  150. 'col' => '*',
  151. ),
  152. ),
  153. );