time.php 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <?php
  2. $type = array
  3. (
  4. 1 => '普通价格',
  5. 2 => '超值价格',
  6. );
  7. $time_type = array
  8. (
  9. 1 => '天',
  10. 2 => '周',
  11. 3 => '月',
  12. 4 => '年',
  13. );
  14. # 获取小刊分类权限
  15. $auth = Dever::tops();
  16. $cate = function() use ($auth)
  17. {
  18. $array = array();
  19. if ($auth) {
  20. $info = Dever::db('journal/cate')->getIds(array('ids' => $auth));
  21. } else {
  22. $info = Dever::db('journal/cate')->state();
  23. }
  24. if($info)
  25. {
  26. $array += $info;
  27. }
  28. return $array;
  29. };
  30. return array
  31. (
  32. # 表名
  33. 'name' => 'time',
  34. # 显示给用户看的名称
  35. 'lang' => '时长设置',
  36. # 后台菜单排序
  37. 'order' => 19,
  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. 'list' => true,
  50. 'order' => 'desc',
  51. ),
  52. 'cate_id' => array
  53. (
  54. 'type' => 'int-11',
  55. 'name' => '小刊分类',
  56. 'default' => '1',
  57. 'desc' => '小刊分类',
  58. 'match' => 'is_numeric',
  59. 'update' => 'select',
  60. 'option' => $cate,
  61. //'search' => 'select',
  62. 'list' => true,
  63. ),
  64. 'name' => array
  65. (
  66. 'type' => 'varchar-300',
  67. 'name' => '时长名称-如1年',
  68. 'default' => '',
  69. 'desc' => '时长名称',
  70. 'match' => 'option',
  71. 'search' => 'fulltext',
  72. 'update' => 'text',
  73. 'list' => true,
  74. ),
  75. 'time_type' => array
  76. (
  77. 'type' => 'int-11',
  78. 'name' => '时长单位设置',
  79. 'default' => '1',
  80. 'desc' => '时长单位设置',
  81. 'match' => 'is_numeric',
  82. 'option' => $time_type,
  83. 'search' => 'select',
  84. 'update' => 'select',
  85. //'list' => true,
  86. ),
  87. 'time' => array
  88. (
  89. 'type' => 'int-11',
  90. 'default' => '',
  91. 'name' => '时长设置-以时长单位为准,直接填写数字即可,如时长单位设置为天,填写7就是7天,请注意,如果时长单位设置为天,这里定义365天,与一年是不同的,有的年份并不是365天,时长单位设置请选择年',
  92. 'match' => 'is_numeric',
  93. 'desc' => '时长设置',
  94. 'update' => 'text',
  95. ),
  96. 'cash' => array
  97. (
  98. 'type' => 'varchar-50',
  99. 'default' => '',
  100. 'name' => '当前价格',
  101. 'match' => 'is_numeric',
  102. 'desc' => '当前价格',
  103. 'update' => 'text',
  104. 'list' => true,
  105. ),
  106. 'price' => array
  107. (
  108. 'type' => 'varchar-50',
  109. 'default' => '',
  110. 'name' => '原价格设置',
  111. 'match' => 'is_numeric',
  112. 'desc' => '原价格设置',
  113. 'update' => 'text',
  114. ),
  115. 'type' => array
  116. (
  117. 'type' => 'int-11',
  118. 'name' => '时长价格类型',
  119. 'default' => '1',
  120. 'desc' => '时长价格类型',
  121. 'match' => 'is_numeric',
  122. 'option' => $type,
  123. 'search' => 'select',
  124. 'update' => 'radio',
  125. //'list' => true,
  126. ),
  127. 'reorder' => array
  128. (
  129. 'type' => 'int-11',
  130. 'name' => '排序(数值越大越靠前)',
  131. 'default' => '1',
  132. 'desc' => '请输入排序',
  133. 'match' => 'option',
  134. 'update' => 'text',
  135. 'search' => 'order',
  136. 'list' => true,
  137. 'order' => 'desc',
  138. 'edit' => true,
  139. ),
  140. 'state' => array
  141. (
  142. 'type' => 'tinyint-1',
  143. 'name' => '状态',
  144. 'default' => '1',
  145. 'desc' => '请选择状态',
  146. 'match' => 'is_numeric',
  147. ),
  148. 'cdate' => array
  149. (
  150. 'type' => 'int-11',
  151. 'name' => '录入时间',
  152. 'match' => array('is_numeric', time()),
  153. 'desc' => '',
  154. # 只有insert时才生效
  155. 'insert' => true,
  156. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  157. ),
  158. ),
  159. 'top' => Dever::config('base')->top,
  160. # 增加这个,为了给当前的list增加一个option
  161. 'top_option' => array
  162. (
  163. 'value' => $auth,
  164. 'col' => 'cate_id',
  165. ),
  166. 'manage' => array
  167. (
  168. //'insert' => false,
  169. //'edit' => false,
  170. //'delete' => false,
  171. ),
  172. 'request' => array
  173. (
  174. 'getAll' => array
  175. (
  176. # 匹配的正则或函数 选填项
  177. 'option' => array
  178. (
  179. 'state' => 1,
  180. ),
  181. 'type' => 'all',
  182. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  183. 'col' => '*',
  184. ),
  185. ),
  186. );