creater.php 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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' => 'collection/lib/content.updateTypeId',
  16. //'update' => 'collection/lib/content.updateTypeId',
  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. 'desc' => array
  42. (
  43. 'type' => 'varchar-30',
  44. 'name' => '简称',
  45. 'default' => '',
  46. 'desc' => '简称',
  47. 'match' => 'is_string',
  48. 'update' => 'text',
  49. 'list' => true,
  50. 'search' => 'fulltext',
  51. ),
  52. 'logo' => array
  53. (
  54. 'type' => 'varchar-150',
  55. 'name' => 'logo',
  56. 'default' => '',
  57. 'desc' => 'logo',
  58. 'match' => 'is_string',
  59. 'update' => 'image',
  60. 'key' => '1',
  61. 'place' => '150',
  62. ),
  63. 'address' => array
  64. (
  65. 'type' => 'varchar-500',
  66. 'name' => '地址',
  67. 'default' => '',
  68. 'desc' => '地址',
  69. 'match' => 'is_string',
  70. 'update' => 'textarea',
  71. 'list' => true,
  72. ),
  73. 'site' => array
  74. (
  75. 'type' => 'varchar-500',
  76. 'name' => '网址',
  77. 'default' => '',
  78. 'desc' => '网址',
  79. 'match' => 'is_string',
  80. 'update' => 'textarea',
  81. ),
  82. 'info' => array
  83. (
  84. 'type' => 'varchar-500',
  85. 'name' => '介绍',
  86. 'default' => '',
  87. 'desc' => '介绍',
  88. 'match' => 'is_string',
  89. 'update' => 'textarea',
  90. ),
  91. 'beizhu' => array
  92. (
  93. 'type' => 'varchar-500',
  94. 'name' => '备注',
  95. 'default' => '',
  96. 'desc' => '备注',
  97. 'match' => 'option',
  98. 'update' => 'textarea',
  99. ),
  100. 'reorder' => array
  101. (
  102. 'type' => 'int-11',
  103. 'name' => '排序(数值越大越靠前)',
  104. 'default' => '1',
  105. 'desc' => '请输入排序',
  106. 'match' => 'option',
  107. //'update' => 'text',
  108. 'search' => 'order',
  109. 'list' => true,
  110. 'order' => 'desc',
  111. 'edit' => true,
  112. ),
  113. 'status' => array
  114. (
  115. 'type' => 'int-11',
  116. 'name' => '登场状态',
  117. 'default' => '1',
  118. 'desc' => '登场状态',
  119. 'match' => 'is_numeric',
  120. 'update' => 'select',
  121. 'option' => $status,
  122. 'search' => 'select',
  123. 'list' => true,
  124. 'edit' => true,
  125. ),
  126. 'state' => array
  127. (
  128. 'type' => 'tinyint-1',
  129. 'name' => '状态',
  130. 'default' => '1',
  131. 'desc' => '请选择状态',
  132. 'match' => 'is_numeric',
  133. ),
  134. 'cdate' => array
  135. (
  136. 'type' => 'int-11',
  137. 'name' => '创建时间',
  138. 'match' => array('is_numeric', time()),
  139. 'desc' => '',
  140. # 只有insert时才生效
  141. 'insert' => true,
  142. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  143. 'search' => 'date',
  144. ),
  145. ),
  146. # 管理功能
  147. 'manage' => array
  148. (
  149. ),
  150. # request 请求接口定义
  151. 'request' => array
  152. (
  153. 'search' => array
  154. (
  155. # 匹配的正则或函数 选填项
  156. 'option' => array
  157. (
  158. 'ids' => array('yes-id', 'in'),
  159. 'name' => array('yes', 'like'),
  160. 'id' => 'yes',
  161. 'status' => 1,
  162. 'state' => 1,
  163. ),
  164. 'type' => 'all',
  165. 'order' => array('reorder' => 'desc','cdate' => 'desc'),
  166. 'limit' => '0,1000',
  167. 'col' => 'name as name, id, id as value, "" as selected, "" as disabled|id',
  168. ),
  169. 'getAll' => array
  170. (
  171. # 匹配的正则或函数 选填项
  172. 'option' => array
  173. (
  174. 'status' => 'yes',
  175. 'state' => 1,
  176. ),
  177. 'type' => 'all',
  178. 'order' => array('reorder' => 'desc','id' => 'desc'),
  179. 'col' => '*',
  180. ),
  181. ),
  182. );