creater.php 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. <?php
  2. $status = array(
  3. 1 => '已登场',
  4. 2 => '未登场',
  5. );
  6. return array
  7. (
  8. # 表名
  9. 'name' => 'creater',
  10. # 显示给用户看的名称
  11. 'lang' => '造物主管理',
  12. 'order' => 100,
  13. 'end' => array
  14. (
  15. 'insert' => 'content/lib/manage.updateCreater',
  16. 'update' => 'content/lib/manage.updateCreater',
  17. ),
  18. # 数据结构
  19. 'struct' => array
  20. (
  21. 'id' => array
  22. (
  23. 'type' => 'int-11',
  24. 'name' => 'ID',
  25. 'default' => '',
  26. 'desc' => '',
  27. 'match' => 'is_numeric',
  28. 'list' => true,
  29. ),
  30. 'name' => array
  31. (
  32. 'type' => 'varchar-80',
  33. 'name' => '名称',
  34. 'default' => '',
  35. 'desc' => '名称',
  36. 'match' => 'is_string',
  37. 'update' => 'text',
  38. 'list' => true,
  39. 'search' => 'fulltext',
  40. ),
  41. 'shou' => array
  42. (
  43. 'type' => 'varchar-80',
  44. 'name' => '首字母',
  45. 'default' => '',
  46. 'desc' => '首字母',
  47. 'match' => 'is_string',
  48. ),
  49. 'desc' => array
  50. (
  51. 'type' => 'varchar-30',
  52. 'name' => '简称',
  53. 'default' => '',
  54. 'desc' => '简称',
  55. 'match' => 'is_string',
  56. //'update' => 'text',
  57. //'list' => true,
  58. //'search' => 'fulltext',
  59. ),
  60. 'logo' => array
  61. (
  62. 'type' => 'varchar-150',
  63. 'name' => 'logo-图片尺寸900*460px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  64. 'default' => '',
  65. 'desc' => 'logo',
  66. 'match' => 'is_string',
  67. 'update' => 'image',
  68. 'key' => '1',
  69. 'place' => '900*460',
  70. ),
  71. 'address' => array
  72. (
  73. 'type' => 'varchar-500',
  74. 'name' => '地址',
  75. 'default' => '',
  76. 'desc' => '地址',
  77. 'match' => 'option',
  78. //'update' => 'textarea',
  79. //'list' => true,
  80. ),
  81. 'site' => array
  82. (
  83. 'type' => 'varchar-500',
  84. 'name' => '网址',
  85. 'default' => '',
  86. 'desc' => '网址',
  87. 'match' => 'option',
  88. 'update' => 'textarea',
  89. ),
  90. 'info' => array
  91. (
  92. 'type' => 'varchar-500',
  93. 'name' => '介绍',
  94. 'default' => '',
  95. 'desc' => '介绍',
  96. 'match' => 'is_string',
  97. 'update' => 'textarea',
  98. ),
  99. 'beizhu' => array
  100. (
  101. 'type' => 'varchar-500',
  102. 'name' => '备注',
  103. 'default' => '',
  104. 'desc' => '备注',
  105. 'match' => 'option',
  106. 'update' => 'textarea',
  107. ),
  108. 'reorder' => array
  109. (
  110. 'type' => 'int-11',
  111. 'name' => '排序(数值越大越靠前)',
  112. 'default' => '1',
  113. 'desc' => '请输入排序',
  114. 'match' => 'option',
  115. //'update' => 'text',
  116. 'search' => 'order',
  117. 'list' => true,
  118. 'order' => 'desc',
  119. 'edit' => true,
  120. ),
  121. 'status' => array
  122. (
  123. 'type' => 'int-11',
  124. 'name' => '登场状态',
  125. 'default' => '1',
  126. 'desc' => '登场状态',
  127. 'match' => 'is_numeric',
  128. 'update' => 'select',
  129. 'option' => $status,
  130. 'search' => 'select',
  131. 'list' => true,
  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. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  151. 'search' => 'date',
  152. ),
  153. ),
  154. # 管理功能
  155. 'manage' => array
  156. (
  157. ),
  158. # request 请求接口定义
  159. 'request' => array
  160. (
  161. 'search' => array
  162. (
  163. # 匹配的正则或函数 选填项
  164. 'option' => array
  165. (
  166. 'ids' => array('yes-id', 'in'),
  167. 'name' => array('yes', 'like'),
  168. 'id' => 'yes',
  169. 'status' => 1,
  170. 'state' => 1,
  171. ),
  172. 'type' => 'all',
  173. 'order' => array('reorder' => 'desc','cdate' => 'desc'),
  174. 'limit' => '0,1000',
  175. 'col' => 'name as name, id, id as value, "" as selected, "" as disabled|id',
  176. ),
  177. 'getData' => array
  178. (
  179. # 匹配的正则或函数 选填项
  180. 'option' => array
  181. (
  182. 'id' => array('yes-id', 'in'),
  183. 'name' => array('yes', 'like'),
  184. 'status' => 1,
  185. 'state' => 1,
  186. ),
  187. 'type' => 'all',
  188. 'order' => array('reorder' => 'desc','cdate' => 'desc'),
  189. 'col' => '*',
  190. ),
  191. 'getAll' => array
  192. (
  193. # 匹配的正则或函数 选填项
  194. 'option' => array
  195. (
  196. 'status' => 'yes',
  197. 'state' => 1,
  198. ),
  199. 'type' => 'all',
  200. 'order' => array('shou' => 'asc', 'reorder' => 'desc', 'id' => 'desc'),
  201. 'col' => '*|shou|',
  202. ),
  203. 'getAllByName' => array
  204. (
  205. # 匹配的正则或函数 选填项
  206. 'option' => array
  207. (
  208. 'name' => array('yes', 'like'),
  209. 'state' => 1,
  210. ),
  211. 'type' => 'all',
  212. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  213. 'col' => '*,name as value,name as label|id',
  214. ),
  215. ),
  216. );