ranking.php 6.7 KB

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