ranking.php 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <?php
  2. $type = array
  3. (
  4. 1 => '门票榜单',
  5. 2 => '购物榜单',
  6. 3 => '邀请榜单',
  7. 4 => '积分榜单',
  8. //5 => '赞赏榜单',
  9. //6 => '贡献榜单',
  10. //7 => '成员榜单',
  11. 10 => '投票榜单',
  12. );
  13. $periods = array
  14. (
  15. //1 => '天',
  16. 2 => '周',
  17. 3 => '月',
  18. 4 => '年',
  19. 5 => '永久',
  20. );
  21. $status = array
  22. (
  23. 1 => '开启',
  24. 2 => '关闭',
  25. );
  26. return array
  27. (
  28. # 表名
  29. 'name' => 'ranking',
  30. # 显示给用户看的名称
  31. 'lang' => '榜单设置',
  32. 'menu' => false,
  33. 'check' => 'info_id,type',
  34. 'ends' => array
  35. (
  36. 'insert' => 'collection/lib/manage.setRankingCache',
  37. 'update' => 'collection/lib/manage.setRankingCache',
  38. ),
  39. # 数据结构
  40. 'struct' => array
  41. (
  42. 'id' => array
  43. (
  44. 'type' => 'int-11',
  45. 'name' => 'ID',
  46. 'default' => '',
  47. 'desc' => '',
  48. 'match' => 'is_numeric',
  49. 'search' => 'order',
  50. 'update' => 'hidden',
  51. //'list' => true,
  52. ),
  53. 'info_id' => array
  54. (
  55. 'type' => 'int-11',
  56. 'name' => '合集',
  57. 'default' => '',
  58. 'desc' => '合集',
  59. 'match' => 'is_numeric',
  60. 'update' => 'hidden',
  61. 'value' => Dever::input('search_option_info_id')
  62. ),
  63. 'name' => array
  64. (
  65. 'type' => 'varchar-80',
  66. 'name' => '榜单标题',
  67. 'default' => '',
  68. 'desc' => '榜单标题',
  69. 'match' => 'is_string',
  70. 'update' => 'text',
  71. 'search' => 'fulltext',
  72. 'list' => true,
  73. ),
  74. 'status' => array
  75. (
  76. 'type' => 'int-11',
  77. 'name' => '榜单状态',
  78. 'default' => '2',
  79. 'desc' => '榜单状态',
  80. 'match' => 'is_numeric',
  81. 'update' => 'radio',
  82. 'option' => $status,
  83. 'list' => true,
  84. 'edit' => true,
  85. ),
  86. 'type' => array
  87. (
  88. 'type' => 'int-11',
  89. 'name' => '榜单类型',
  90. 'default' => '1',
  91. 'desc' => '榜单类型',
  92. 'match' => 'is_numeric',
  93. 'update' => 'radio',
  94. 'option' => $type,
  95. 'list' => true,
  96. ),
  97. 'start' => array
  98. (
  99. 'type' => 'int-11',
  100. 'default' => '',
  101. 'name' => '总榜开始时间',
  102. 'match' => 'option',
  103. 'desc' => '总榜开始时间',
  104. 'update' => 'date',
  105. //'list' => 'date("Y-m-d H:i:s", {start})',
  106. 'callback' => 'maketime',
  107. ),
  108. 'end' => array
  109. (
  110. 'type' => 'int-11',
  111. 'default' => '',
  112. 'name' => '总榜结束时间',
  113. 'match' => 'option',
  114. 'desc' => '总榜结束时间',
  115. 'update' => 'date',
  116. //'list' => 'date("Y-m-d H:i:s", {end})',
  117. 'callback' => 'maketime',
  118. ),
  119. 'periods' => array
  120. (
  121. 'type' => 'int-11',
  122. 'name' => '榜单周期-到周期之后自动生成的一期榜单',
  123. 'default' => '1',
  124. 'desc' => '榜单周期',
  125. 'match' => 'is_numeric',
  126. 'update' => 'radio',
  127. 'option' => $periods,
  128. 'list' => true,
  129. ),
  130. 'desc' => array
  131. (
  132. 'type' => 'text-255',
  133. 'name' => '榜单描述',
  134. 'default' => '',
  135. 'desc' => '榜单描述',
  136. 'match' => 'option',
  137. 'update' => 'editor',
  138. 'key' => 1,
  139. //'search' => 'fulltext',
  140. //'list' => true,
  141. ),
  142. 'reorder' => array
  143. (
  144. 'type' => 'int-11',
  145. 'name' => '排序(数值越大越靠前)',
  146. 'default' => '1',
  147. 'desc' => '请输入排序',
  148. 'match' => 'option',
  149. //'update' => 'text',
  150. 'search' => 'order',
  151. 'list' => true,
  152. 'order' => 'desc',
  153. 'edit' => true,
  154. ),
  155. 'state' => array
  156. (
  157. 'type' => 'tinyint-1',
  158. 'name' => '状态',
  159. 'default' => '1',
  160. 'desc' => '请选择状态',
  161. 'match' => 'is_numeric',
  162. ),
  163. 'cdate' => array
  164. (
  165. 'type' => 'int-11',
  166. 'name' => '创建时间',
  167. 'match' => array('is_numeric', time()),
  168. 'desc' => '',
  169. # 只有insert时才生效
  170. 'insert' => true,
  171. 'search' => 'date',
  172. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  173. ),
  174. ),
  175. 'manage' => array
  176. (
  177. //'delete' => false,
  178. # 列表
  179. 'list_button' => array
  180. (
  181. 'list1' => array('榜单期数', '"ranking_periods&search_option_info_id={info_id}&search_option_ranking_id={id}&top_table=ranking_data&oper_table=ranking&top_table=info"'),
  182. 'list' => array('榜单数据', '"ranking_data&search_option_info_id={info_id}&search_option_ranking_id={id}&top_table=ranking_data&oper_table=ranking&top_table=info"', '{type} < 10'),
  183. 'list2' => array('投票设置', '"ranking_vote&search_option_info_id={info_id}&search_option_ranking_id={id}&top_table=ranking_vote&oper_table=ranking&top_table=info"', '{type} == 10'),
  184. ),
  185. ),
  186. 'request' => array
  187. (
  188. 'getAll' => array
  189. (
  190. # 匹配的正则或函数 选填项
  191. 'option' => array
  192. (
  193. 'info_id' => 'yes',
  194. 'type' => 'yes',
  195. 'state' => 1,
  196. 'status' => 1,
  197. ),
  198. 'type' => 'all',
  199. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  200. 'col' => '*',
  201. ),
  202. 'getOne' => array
  203. (
  204. # 匹配的正则或函数 选填项
  205. 'option' => array
  206. (
  207. 'info_id' => 'yes',
  208. 'type' => 'yes',
  209. 'state' => 1,
  210. 'status' => 1,
  211. ),
  212. 'type' => 'one',
  213. 'col' => '*',
  214. ),
  215. ),
  216. );