ranking.php 6.3 KB

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