ranking_periods.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <?php
  2. $status = array
  3. (
  4. 1 => '开启',
  5. 2 => '关闭',
  6. );
  7. return array
  8. (
  9. # 表名
  10. 'name' => 'ranking_periods',
  11. # 显示给用户看的名称
  12. 'lang' => '榜单期数',
  13. 'menu' => false,
  14. 'check' => 'info_id,ranking_id,periods',
  15. # 数据结构
  16. 'struct' => array
  17. (
  18. 'id' => array
  19. (
  20. 'type' => 'int-11',
  21. 'name' => 'ID',
  22. 'default' => '',
  23. 'desc' => '',
  24. 'match' => 'is_numeric',
  25. 'search' => 'order',
  26. 'update' => 'hidden',
  27. //'list' => true,
  28. ),
  29. 'info_id' => array
  30. (
  31. 'type' => 'int-11',
  32. 'name' => '合集',
  33. 'default' => '',
  34. 'desc' => '合集',
  35. 'match' => 'is_numeric',
  36. 'update' => 'hidden',
  37. 'value' => Dever::input('search_option_info_id')
  38. ),
  39. 'ranking_id' => array
  40. (
  41. 'type' => 'int-11',
  42. 'name' => '榜单id',
  43. 'default' => '',
  44. 'desc' => '榜单id',
  45. 'match' => 'is_numeric',
  46. 'update' => 'hidden',
  47. 'value' => Dever::input('search_option_ranking_id')
  48. ),
  49. 'name' => array
  50. (
  51. 'type' => 'varchar-80',
  52. 'name' => '本期标题',
  53. 'default' => '',
  54. 'desc' => '本期标题',
  55. 'match' => 'is_string',
  56. 'update' => 'text',
  57. 'search' => 'fulltext',
  58. 'list' => true,
  59. ),
  60. 'periods' => array
  61. (
  62. 'type' => 'int-11',
  63. 'name' => '期数',
  64. 'default' => '',
  65. 'desc' => '期数',
  66. 'match' => 'is_numeric',
  67. 'update' => 'text',
  68. 'list' => true,
  69. ),
  70. 'status' => array
  71. (
  72. 'type' => 'int-11',
  73. 'name' => '本期状态-手动设置状态,也可以设置下方的时间来自动控制',
  74. 'default' => '1',
  75. 'desc' => '本期状态',
  76. 'match' => 'is_numeric',
  77. 'update' => 'radio',
  78. 'option' => $status,
  79. 'list' => true,
  80. 'edit' => true,
  81. ),
  82. 'start' => array
  83. (
  84. 'type' => 'int-11',
  85. 'default' => '',
  86. 'name' => '本期开始时间-可以为空,则按照总榜设置的榜单周期自动开始',
  87. 'match' => 'option',
  88. 'desc' => '本期开始时间',
  89. 'update' => 'date',
  90. 'list' => 'date("Y-m-d H:i:s", {start})',
  91. 'callback' => 'maketime',
  92. ),
  93. 'end' => array
  94. (
  95. 'type' => 'int-11',
  96. 'default' => '',
  97. 'name' => '本期结束时间-可以为空,则按照总榜设置的榜单周期自动结束',
  98. 'match' => 'option',
  99. 'desc' => '本期结束时间',
  100. 'update' => 'date',
  101. 'list' => '{end} ? date("Y-m-d H:i:s", {end}) : "无"',
  102. 'callback' => 'maketime',
  103. ),
  104. 'state' => array
  105. (
  106. 'type' => 'tinyint-1',
  107. 'name' => '状态',
  108. 'default' => '1',
  109. 'desc' => '请选择状态',
  110. 'match' => 'is_numeric',
  111. ),
  112. 'cdate' => array
  113. (
  114. 'type' => 'int-11',
  115. 'name' => '创建时间',
  116. 'match' => array('is_numeric', time()),
  117. 'desc' => '',
  118. # 只有insert时才生效
  119. 'insert' => true,
  120. 'search' => 'date',
  121. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  122. ),
  123. ),
  124. 'manage' => array
  125. (
  126. //'insert' => false,
  127. 'delete' => false,
  128. ),
  129. 'request' => array
  130. (
  131. 'getAll' => array
  132. (
  133. # 匹配的正则或函数 选填项
  134. 'option' => array
  135. (
  136. 'info_id' => 'yes',
  137. 'ranking_id' => 'yes',
  138. //'status' => 1,
  139. 'state' => 1,
  140. ),
  141. 'type' => 'all',
  142. 'order' => array('status' => 'asc', 'periods' => 'desc', 'cdate' => 'desc'),
  143. 'limit' => '0,20',
  144. 'col' => '*',
  145. ),
  146. # 获取当前最新的期数
  147. 'getNew' => array
  148. (
  149. # 匹配的正则或函数 选填项
  150. 'option' => array
  151. (
  152. 'info_id' => 'yes',
  153. 'ranking_id' => 'yes',
  154. 'status' => 1,
  155. 'state' => 1,
  156. ),
  157. 'type' => 'one',
  158. 'order' => array('periods' => 'desc', 'cdate' => 'desc'),
  159. 'col' => '*',
  160. ),
  161. ),
  162. );