col.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <?php
  2. $type = array
  3. (
  4. 1 => '普通文本',
  5. 2 => '长文本',
  6. 3 => '编辑器',
  7. 4 => '单张图片',
  8. 5 => '多张图片',
  9. 6 => '单项选择',
  10. 7 => '多项选择',
  11. 8 => '时间选择',
  12. );
  13. return array
  14. (
  15. # 表名
  16. 'name' => 'col',
  17. # 显示给用户看的名称
  18. 'lang' => '字段设置',
  19. # 后台菜单排序
  20. 'order' => 2,
  21. 'menu' => false,
  22. # 数据结构
  23. 'struct' => array
  24. (
  25. 'id' => array
  26. (
  27. 'type' => 'int-11',
  28. 'name' => 'ID',
  29. 'default' => '',
  30. 'desc' => '',
  31. 'match' => 'is_numeric',
  32. 'search' => 'order',
  33. 'list' => true,
  34. 'order' => 'desc',
  35. ),
  36. 'name' => array
  37. (
  38. 'type' => 'varchar-32',
  39. 'name' => '字段名称',
  40. 'default' => '',
  41. 'desc' => '字段名称',
  42. 'match' => 'is_string',
  43. 'update' => 'text',
  44. 'search' => 'fulltext',
  45. 'list' => true,
  46. ),
  47. 'desc' => array
  48. (
  49. 'type' => 'varchar-200',
  50. 'name' => '字段描述',
  51. 'default' => '',
  52. 'desc' => '字段描述',
  53. 'match' => 'is_string',
  54. 'update' => 'text',
  55. 'search' => 'fulltext',
  56. 'list' => true,
  57. ),
  58. 'type' => array
  59. (
  60. 'type' => 'tinyint-1',
  61. 'name' => '类型',
  62. 'default' => '1',
  63. 'desc' => '类型',
  64. 'match' => 'is_numeric',
  65. 'update' => 'select',
  66. 'option' => $type,
  67. 'search' => 'select',
  68. 'list' => true,
  69. 'control' => 'type',
  70. ),
  71. 'pic' => array
  72. (
  73. 'type' => 'varchar-20',
  74. 'name' => '图片尺寸提醒-请直接输入尺寸,如100*100',
  75. 'default' => '',
  76. 'desc' => '图片尺寸提醒',
  77. 'match' => 'is_string',
  78. 'update' => 'text',
  79. 'show' => 'type=4,5',
  80. ),
  81. 'option' => array
  82. (
  83. 'type' => 'varchar-1000',
  84. 'name' => '可选项-每行一个选项,多个直接换行',
  85. 'default' => '',
  86. 'desc' => '可选项',
  87. 'match' => 'is_string',
  88. 'update' => 'textarea',
  89. 'show' => 'type=6,7',
  90. ),
  91. 'reorder' => array
  92. (
  93. 'type' => 'int-11',
  94. 'name' => '排序(数值越大越靠前)',
  95. 'default' => '1',
  96. 'desc' => '请输入排序',
  97. 'match' => 'option',
  98. 'update' => 'text',
  99. 'search' => 'order',
  100. 'list' => true,
  101. 'order' => 'desc',
  102. 'edit' => true,
  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. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  121. ),
  122. ),
  123. 'manage' => array
  124. (
  125. 'insert' => false,
  126. 'edit' => false,
  127. # 自定义快捷新增和编辑
  128. 'button' => array
  129. (
  130. '新增' => array('fast'),
  131. ),
  132. # 快捷更新
  133. 'list_button' => array
  134. (
  135. 'edit' => array('编辑'),
  136. ),
  137. ),
  138. 'request' => array
  139. (
  140. 'state' => array
  141. (
  142. # 匹配的正则或函数 选填项
  143. 'option' => array
  144. (
  145. 'state' => 1,
  146. ),
  147. 'type' => 'all',
  148. 'order' => array('reorder' => 'desc','id' => 'desc'),
  149. 'col' => '*',
  150. ),
  151. 'getAll' => array
  152. (
  153. # 匹配的正则或函数 选填项
  154. 'option' => array
  155. (
  156. 'state' => 1,
  157. # 小程序去掉视频栏目
  158. 'id_no' => array('yes-id', '!='),
  159. ),
  160. 'type' => 'all',
  161. 'order' => array('reorder' => 'desc','id' => 'desc'),
  162. 'col' => '*',
  163. ),
  164. ),
  165. );