times.php 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <?php
  2. $times_id = Dever::input('option_times_id', -1);
  3. return array
  4. (
  5. # 表名
  6. 'name' => 'times',
  7. # 显示给用户看的名称
  8. 'lang' => '时光管理',
  9. # 是否显示在后台菜单
  10. 'order' => 1,
  11. 'menu' => false,
  12. # 数据结构
  13. 'struct' => array
  14. (
  15. 'id' => array
  16. (
  17. 'type' => 'int-11',
  18. 'name' => 'ID',
  19. 'default' => '',
  20. 'desc' => '',
  21. 'match' => 'is_numeric',
  22. 'order' => 'asc',
  23. 'list' => true,
  24. ),
  25. 'info_id' => array
  26. (
  27. 'type' => 'int-11',
  28. 'name' => '合集',
  29. 'default' => '',
  30. 'desc' => '合集',
  31. 'match' => 'is_numeric',
  32. 'update' => 'hidden',
  33. 'value' => Dever::input('search_option_info_id')
  34. ),
  35. 'name' => array
  36. (
  37. 'type' => 'varchar-150',
  38. 'name' => '时光名称',
  39. 'default' => '',
  40. 'desc' => '时光名称',
  41. 'match' => 'is_string',
  42. 'update' => 'text',
  43. 'search' => 'fulltext',
  44. 'list' => true,
  45. 'edit' => true,
  46. ),
  47. 'year' => array
  48. (
  49. 'type' => 'int-11',
  50. 'name' => '年份-影响当前时光下所有发布内容的时间,主线无需填写',
  51. 'default' => '',
  52. 'desc' => '年份',
  53. 'match' => 'is_numeric',
  54. 'update' => $times_id < 0 ? 'hidden': 'year',
  55. 'search' => 'text',
  56. 'order' => 'desc',
  57. 'list' => true,
  58. ),
  59. 'times_id' => array
  60. (
  61. 'type' => 'int-11',
  62. 'name' => '上级时光',
  63. 'default' => '-1',
  64. 'desc' => '请选择上级时光',
  65. 'match' => 'is_numeric',
  66. 'update' => 'hidden',
  67. 'value' => $times_id,
  68. 'list' => '{times_id} > 0 ? Dever::load("collection/times-one#name", {times_id}) : "主时间线"',
  69. ),
  70. 'icon' => array
  71. (
  72. 'type' => 'varchar-150',
  73. 'name' => '时光图标-图片尺寸80*80px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  74. 'default' => '',
  75. 'desc' => '时光图标',
  76. 'match' => 'option',
  77. 'update' => $times_id < 0 ? 'hidden': 'image',
  78. 'key' => '1',
  79. 'place' => '80*80',
  80. ),
  81. 'pic' => array
  82. (
  83. 'type' => 'varchar-150',
  84. 'name' => '图片-图片尺寸330*330px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  85. 'default' => '',
  86. 'desc' => '图片',
  87. 'match' => 'option',
  88. 'update' => $times_id < 0 ? 'hidden': 'image',
  89. 'key' => '1',
  90. 'place' => '330*330',
  91. ),
  92. 'desc' => array
  93. (
  94. 'type' => 'varchar-800',
  95. 'name' => '描述',
  96. 'default' => '',
  97. 'desc' => '描述',
  98. 'match' => 'option',
  99. 'update' => $times_id < 0 ? 'hidden': 'text',
  100. //'list' => true,
  101. ),
  102. 'color' => array
  103. (
  104. 'type' => 'varchar-10',
  105. 'name' => '文字颜色-默认为白色',
  106. 'default' => '#ffffff',
  107. 'desc' => '文字颜色',
  108. 'match' => 'is_string',
  109. 'update' => $times_id < 0 ? 'hidden': 'color',
  110. ),
  111. 'bgcolor' => array
  112. (
  113. 'type' => 'varchar-10',
  114. 'name' => '背景颜色-默认为灰色',
  115. 'default' => '#cccccc',
  116. 'desc' => '背景颜色',
  117. 'match' => 'is_string',
  118. 'update' => $times_id < 0 ? 'hidden': 'color',
  119. ),
  120. 'reorder' => array
  121. (
  122. 'type' => 'int-11',
  123. 'name' => '排序(数值越小越靠前)',
  124. 'default' => '1',
  125. 'desc' => '请输入排序',
  126. 'match' => 'option',
  127. 'update' => 'text',
  128. 'search' => 'order',
  129. 'list_name' => '排序',
  130. 'list' => true,
  131. 'order' => 'asc',
  132. 'edit' => true,
  133. ),
  134. 'state' => array
  135. (
  136. 'type' => 'tinyint-1',
  137. 'name' => '状态',
  138. 'default' => '1',
  139. 'desc' => '请选择状态',
  140. 'match' => 'is_numeric',
  141. ),
  142. 'cdate' => array
  143. (
  144. 'type' => 'int-11',
  145. 'name' => '录入时间',
  146. 'match' => array('is_numeric', time()),
  147. 'desc' => '',
  148. # 只有insert时才生效
  149. 'insert' => true,
  150. 'order' => 'asc',
  151. //'search' => 'date',
  152. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  153. ),
  154. ),
  155. 'manage' => array
  156. (
  157. # 列表页的类型
  158. 'list_type' => 'tree',
  159. 'list_button' => array
  160. (
  161. 'update' => array('编辑', 'times&option_times_id={times_id}'),
  162. 'add' => array('新增时间线', '"{times_id}" == -1 ? "times&option_times_id={id}" : "times&option_times_id={times_id},{id}"', '{times_id} == -1'),
  163. 'delete' => '删除',
  164. ),
  165. ),
  166. 'request' => array
  167. (
  168. 'child' => array
  169. (
  170. 'option' => array
  171. (
  172. 'state' => 1,
  173. 'times_id' => 'yes',
  174. 'info_id' => 'yes',
  175. ),
  176. 'type' => 'all',
  177. 'order' => array('year' => 'asc', 'reorder' => 'asc', 'id' => 'asc'),
  178. 'col' => '*',
  179. ),
  180. 'main' => array
  181. (
  182. 'option' => array
  183. (
  184. 'state' => 1,
  185. 'times_id' => -1,
  186. 'info_id' => 'yes',
  187. ),
  188. 'type' => 'all',
  189. 'order' => array('year' => 'asc', 'reorder' => 'asc', 'id' => 'asc'),
  190. 'col' => '*',
  191. ),
  192. 'mainAll' => array
  193. (
  194. 'option' => array
  195. (
  196. 'state' => 1,
  197. 'times_id' => -1,
  198. 'info_id' => 'yes',
  199. ),
  200. 'type' => 'all',
  201. 'order' => array('year' => 'asc', 'reorder' => 'asc', 'id' => 'asc'),
  202. 'col' => '*|id',
  203. ),
  204. # 取所有下级
  205. 'childAll' => array
  206. (
  207. 'option' => array
  208. (
  209. 'times_id' => array(1, '>='),
  210. 'info_id' => 'yes',
  211. 'state' => 1,
  212. ),
  213. 'type' => 'all',
  214. 'order' => array('year' => 'asc', 'reorder' => 'asc', 'id' => 'asc'),
  215. 'col' => '*|times_id|id|',
  216. ),
  217. 'getNew' => array
  218. (
  219. 'option' => array
  220. (
  221. 'state' => 1,
  222. 'times_id' => array(1, '>='),
  223. 'year' => 'yes',
  224. 'info_id' => 'yes',
  225. ),
  226. 'type' => 'one',
  227. 'order' => array('year' => 'asc', 'reorder' => 'asc', 'id' => 'asc'),
  228. 'col' => '*',
  229. ),
  230. )
  231. );