info.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <?php
  2. $cate = function()
  3. {
  4. $array = array();
  5. $info = Dever::db('product/cate')->state();
  6. if($info)
  7. {
  8. $array += $info;
  9. }
  10. return $array;
  11. };
  12. return array
  13. (
  14. # 表名
  15. 'name' => 'info',
  16. # 显示给用户看的名称
  17. 'lang' => '产品管理',
  18. # 后台菜单排序
  19. 'order' => 1,
  20. # 数据结构
  21. 'struct' => array
  22. (
  23. 'id' => array
  24. (
  25. 'type' => 'int-11',
  26. 'name' => 'ID',
  27. 'default' => '',
  28. 'desc' => '',
  29. 'match' => 'is_numeric',
  30. 'search' => 'order',
  31. 'list' => true,
  32. 'order' => 'desc',
  33. ),
  34. 'name' => array
  35. (
  36. 'type' => 'varchar-80',
  37. 'name' => '名称',
  38. 'default' => '',
  39. 'desc' => '名称',
  40. 'match' => 'is_string',
  41. 'update' => 'text',
  42. 'search' => 'fulltext',
  43. 'list' => true,
  44. ),
  45. 'cate_id' => array
  46. (
  47. 'type' => 'int-11',
  48. 'name' => '所属分类',
  49. 'default' => '1',
  50. 'desc' => '所属分类',
  51. 'match' => 'is_numeric',
  52. 'update' => 'select',
  53. 'option' => $cate,
  54. 'search' => 'select',
  55. ),
  56. 'price' => array
  57. (
  58. 'type' => 'varchar-180',
  59. 'name' => '价格',
  60. 'default' => '',
  61. 'desc' => '价格',
  62. 'match' => 'is_string',
  63. 'update' => 'text',
  64. 'search' => 'fulltext',
  65. 'list' => true,
  66. ),
  67. 'pic' => array
  68. (
  69. 'type' => 'varchar-150',
  70. 'name' => '图片-图片尺寸750*750px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  71. 'default' => '',
  72. 'desc' => '图片',
  73. 'match' => 'option',
  74. 'update' => 'image',
  75. 'key' => '1',
  76. 'place' => '150',
  77. ),
  78. 'content' => array
  79. (
  80. 'type' => 'text-255',
  81. 'name' => '内容描述',
  82. 'default' => '',
  83. 'desc' => '内容描述',
  84. 'match' => 'is_string',
  85. 'update' => 'editor',
  86. ),
  87. 'buy_link' => array
  88. (
  89. 'type' => 'varchar-800',
  90. 'name' => '购买链接-可以为空,为空则不跳转',
  91. 'default' => '',
  92. 'desc' => '购买链接',
  93. 'match' => 'option',
  94. 'update' => 'text',
  95. 'search' => 'fulltext',
  96. ),
  97. 'reorder' => array
  98. (
  99. 'type' => 'int-11',
  100. 'name' => '排序(数值越大越靠前)',
  101. 'default' => '1',
  102. 'desc' => '请输入排序',
  103. 'match' => 'option',
  104. 'update' => 'text',
  105. 'search' => 'order',
  106. 'list' => true,
  107. 'order' => 'desc',
  108. 'edit' => true,
  109. ),
  110. 'state' => array
  111. (
  112. 'type' => 'tinyint-1',
  113. 'name' => '状态',
  114. 'default' => '1',
  115. 'desc' => '请选择状态',
  116. 'match' => 'is_numeric',
  117. ),
  118. 'cdate' => array
  119. (
  120. 'type' => 'int-11',
  121. 'name' => '录入时间',
  122. 'match' => array('is_numeric', time()),
  123. 'desc' => '',
  124. # 只有insert时才生效
  125. 'insert' => true,
  126. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  127. ),
  128. ),
  129. 'manage' => array
  130. (
  131. ),
  132. 'request' => array
  133. (
  134. 'getAll' => array
  135. (
  136. # 匹配的正则或函数 选填项
  137. 'option' => array
  138. (
  139. 'ids' => array('yes-id', 'in'),
  140. 'name' => array('yes', 'like'),
  141. 'id' => 'yes',
  142. 'state' => 1,
  143. ),
  144. 'type' => 'all',
  145. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  146. 'limit' => '0,1000',
  147. 'col' => 'name as name, id, id as value, "" as selected, "" as disabled|id',
  148. ),
  149. 'getAllByIds' => array
  150. (
  151. # 匹配的正则或函数 选填项
  152. 'option' => array
  153. (
  154. 'ids' => array('yes-id', 'in'),
  155. 'id' => 'yes',
  156. 'state' => 1,
  157. ),
  158. 'type' => 'all',
  159. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  160. 'col' => '*',
  161. ),
  162. 'search' => array
  163. (
  164. # 匹配的正则或函数 选填项
  165. 'option' => array
  166. (
  167. 'ids' => array('yes-id', 'in'),
  168. 'name' => array('yes', 'like'),
  169. 'id' => 'yes',
  170. 'state' => 1,
  171. ),
  172. 'type' => 'all',
  173. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  174. 'limit' => '0,1000',
  175. 'col' => 'name as name, id, id as value, "" as selected, "" as disabled|id',
  176. ),
  177. ),
  178. );