ranking.php 6.5 KB

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