col.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. <?php
  2. $type = array
  3. (
  4. 1 => '普通文本',
  5. 2 => '长文本',
  6. 3 => '编辑器',
  7. 4 => '单张图片',
  8. 5 => '多张图片',
  9. 6 => '单项选择',
  10. //7 => '多项选择',
  11. 8 => '时间选择',
  12. );
  13. $is_option = array
  14. (
  15. 1 => '必填',
  16. 2 => '选填',
  17. );
  18. $list_show = array
  19. (
  20. 1 => '展示',
  21. 2 => '不展示',
  22. );
  23. return array
  24. (
  25. # 表名
  26. 'name' => 'col',
  27. # 显示给用户看的名称
  28. 'lang' => '字段设置',
  29. # 后台菜单排序
  30. 'order' => 2,
  31. 'menu' => false,
  32. 'check' => 'key',
  33. # 数据结构
  34. 'struct' => array
  35. (
  36. 'id' => array
  37. (
  38. 'type' => 'int-11',
  39. 'name' => 'ID',
  40. 'default' => '',
  41. 'desc' => '',
  42. 'match' => 'is_numeric',
  43. 'search' => 'order',
  44. 'list' => true,
  45. 'order' => 'desc',
  46. ),
  47. 'name' => array
  48. (
  49. 'type' => 'varchar-32',
  50. 'name' => '字段名称',
  51. 'default' => '',
  52. 'desc' => '字段名称',
  53. 'match' => 'is_string',
  54. 'update' => 'text',
  55. 'search' => 'fulltext',
  56. 'list' => true,
  57. ),
  58. 'key' => array
  59. (
  60. 'type' => 'varchar-32',
  61. 'name' => '字段标识',
  62. 'default' => '',
  63. 'desc' => '字段标识',
  64. 'match' => 'is_string',
  65. 'update' => 'text',
  66. 'search' => 'fulltext',
  67. 'list' => true,
  68. ),
  69. 'desc' => array
  70. (
  71. 'type' => 'varchar-200',
  72. 'name' => '字段描述',
  73. 'default' => '',
  74. 'desc' => '字段描述',
  75. 'match' => 'is_string',
  76. 'update' => 'text',
  77. 'search' => 'fulltext',
  78. 'list' => true,
  79. ),
  80. 'type' => array
  81. (
  82. 'type' => 'tinyint-1',
  83. 'name' => '类型',
  84. 'default' => '1',
  85. 'desc' => '类型',
  86. 'match' => 'is_numeric',
  87. 'update' => 'radio',
  88. 'option' => $type,
  89. 'search' => 'select',
  90. 'list' => true,
  91. 'control' => 'type',
  92. ),
  93. 'is_option' => array
  94. (
  95. 'type' => 'tinyint-1',
  96. 'name' => '是否必填',
  97. 'default' => '1',
  98. 'desc' => '是否必填',
  99. 'match' => 'is_numeric',
  100. 'update' => 'radio',
  101. 'option' => $is_option,
  102. 'search' => 'select',
  103. 'list' => true,
  104. 'edit' => true,
  105. ),
  106. 'list_show' => array
  107. (
  108. 'type' => 'tinyint-1',
  109. 'name' => '列表页是否展示',
  110. 'default' => '1',
  111. 'desc' => '列表页是否展示',
  112. 'match' => 'is_numeric',
  113. 'update' => 'radio',
  114. 'option' => $list_show,
  115. ),
  116. 'pic' => array
  117. (
  118. 'type' => 'varchar-20',
  119. 'name' => '图片尺寸提醒-请直接输入尺寸,如100*100',
  120. 'default' => '',
  121. 'desc' => '图片尺寸提醒',
  122. 'match' => 'option',
  123. 'update' => 'text',
  124. 'show' => 'type=4,5',
  125. ),
  126. 'page/col_option' => array
  127. (
  128. 'name' => '可选项',
  129. 'default' => '',
  130. 'desc' => '可选项',
  131. 'sync' => array('col_id' => 'id'),
  132. 'update' => array(1),
  133. 'update_type' => 2,
  134. /*
  135. 'option' => array(0 => array
  136. (
  137. //'id' => 1,
  138. 'name' => '商品列表页112',
  139. //'value' => 'shoplist11',
  140. )),*/
  141. 'show' => 'type=6,7',
  142. ),
  143. 'reorder' => array
  144. (
  145. 'type' => 'int-11',
  146. 'name' => '排序-数值越小越靠前',
  147. 'default' => '1',
  148. 'desc' => '请输入排序',
  149. 'match' => 'option',
  150. 'update' => 'text',
  151. 'search' => 'order',
  152. 'list' => true,
  153. 'order' => 'asc',
  154. 'edit' => true,
  155. ),
  156. 'state' => array
  157. (
  158. 'type' => 'tinyint-1',
  159. 'name' => '状态',
  160. 'default' => '1',
  161. 'desc' => '请选择状态',
  162. 'match' => 'is_numeric',
  163. ),
  164. 'cdate' => array
  165. (
  166. 'type' => 'int-11',
  167. 'name' => '录入时间',
  168. 'match' => array('is_numeric', time()),
  169. 'desc' => '',
  170. # 只有insert时才生效
  171. 'insert' => true,
  172. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  173. ),
  174. ),
  175. 'manage' => array
  176. (
  177. 'insert' => false,
  178. 'edit' => false,
  179. # 自定义快捷新增和编辑
  180. 'button' => array
  181. (
  182. '新增' => array('fast'),
  183. ),
  184. # 快捷更新
  185. 'list_button' => array
  186. (
  187. 'edit' => array('编辑'),
  188. ),
  189. ),
  190. 'default' => array
  191. (
  192. 'col' => '`name`,`key`,`desc`,`type`,`state`,`cdate`',
  193. 'value' => array
  194. (
  195. '"标题","name","标题",1, 1,' . DEVER_TIME,
  196. '"图片","pic","图片",4, 1,' . DEVER_TIME,
  197. '"链接","link","链接",1, 1,' . DEVER_TIME,
  198. ),
  199. ),
  200. 'request' => array
  201. (
  202. 'state' => array
  203. (
  204. # 匹配的正则或函数 选填项
  205. 'option' => array
  206. (
  207. 'state' => 1,
  208. ),
  209. 'type' => 'all',
  210. 'order' => array('reorder' => 'asc','id' => 'desc'),
  211. 'col' => '*',
  212. ),
  213. 'getAll' => array
  214. (
  215. # 匹配的正则或函数 选填项
  216. 'option' => array
  217. (
  218. 'state' => 1,
  219. //'id' => array('yes', 'in'),
  220. //'id_no' => array('yes-id', '!='),
  221. ),
  222. 'type' => 'all',
  223. 'order' => array('reorder' => 'asc','id' => 'asc'),
  224. 'col' => '*',
  225. ),
  226. ),
  227. );