company.php 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <?php
  2. # 常用的col
  3. $col = '*';
  4. $cate = function()
  5. {
  6. $array = array();
  7. $info = Dever::db('content/service_cate')->state();
  8. if($info)
  9. {
  10. $array += $info;
  11. }
  12. return $array;
  13. };
  14. return array
  15. (
  16. # 表名
  17. 'name' => 'company',
  18. # 显示给用户看的名称
  19. 'lang' => '公司介绍',
  20. 'order' => 98,
  21. # 数据结构
  22. 'struct' => array
  23. (
  24. 'id' => array
  25. (
  26. 'type' => 'int-11',
  27. 'name' => 'ID',
  28. 'default' => '',
  29. 'desc' => '',
  30. 'match' => 'is_numeric',
  31. 'list' => true,
  32. ),
  33. 'name' => array
  34. (
  35. 'type' => 'varchar-80',
  36. 'name' => '标题',
  37. 'default' => '',
  38. 'desc' => '标题',
  39. 'match' => 'is_string',
  40. 'update' => 'text',
  41. 'list' => true,
  42. 'search' => 'fulltext',
  43. ),
  44. 'desc' => array
  45. (
  46. 'type' => 'varchar-500',
  47. 'name' => '描述',
  48. 'default' => '',
  49. 'desc' => '描述',
  50. 'match' => 'is_string',
  51. 'update' => 'textarea',
  52. ),
  53. 'top_name' => array
  54. (
  55. 'type' => 'varchar-80',
  56. 'name' => '顶部标题',
  57. 'default' => '',
  58. 'desc' => '标题',
  59. 'match' => 'is_string',
  60. 'update' => 'text',
  61. 'list' => true,
  62. 'search' => 'fulltext',
  63. ),
  64. 'top_desc' => array
  65. (
  66. 'type' => 'varchar-500',
  67. 'name' => '顶部描述',
  68. 'default' => '',
  69. 'desc' => '描述',
  70. 'match' => 'is_string',
  71. 'update' => 'textarea',
  72. ),
  73. 'top' => array
  74. (
  75. 'type' => 'varchar-150',
  76. 'name' => '顶部图',
  77. 'default' => '',
  78. 'desc' => '顶部图',
  79. 'match' => 'option',
  80. 'update' => 'image',
  81. 'key' => '1',
  82. 'place' => '882*147',
  83. ),
  84. 'content' => array
  85. (
  86. 'type' => 'text-255',
  87. 'name' => '内容',
  88. 'default' => '',
  89. 'desc' => '请输入内容',
  90. 'match' => 'is_string',
  91. 'update' => 'editor',
  92. 'key' => '1',
  93. ),
  94. 'reorder' => array
  95. (
  96. 'type' => 'int-11',
  97. 'name' => '排序-数值越大越靠前,相当于置顶',
  98. 'default' => '1',
  99. 'desc' => '请输入排序',
  100. 'match' => 'option',
  101. //'update' => 'text',
  102. 'search' => 'order',
  103. 'list' => true,
  104. 'order' => 'desc',
  105. 'edit' => true,
  106. ),
  107. 'state' => array
  108. (
  109. 'type' => 'tinyint-1',
  110. 'name' => '状态',
  111. 'default' => '1',
  112. 'desc' => '请选择状态',
  113. 'match' => 'is_numeric',
  114. ),
  115. 'cdate' => array
  116. (
  117. 'type' => 'int-11',
  118. 'name' => '录入时间',
  119. 'match' => array('is_numeric', time()),
  120. 'desc' => '',
  121. # 只有insert时才生效
  122. 'insert' => true,
  123. 'list' => 'date("Y-m-d H:i", {cdate})',
  124. ),
  125. ),
  126. # 管理功能
  127. 'manage' => array
  128. (
  129. 'lang' => 'name,desc,content,top_name,top_desc',
  130. # 列表
  131. 'list_button' => array
  132. (
  133. //'edit' => array('预览', str_replace('https://api.', 'http://www.', Dever::url('main/preview.get?type=1'))),
  134. ),
  135. ),
  136. # request 请求接口定义
  137. 'request' => array
  138. (
  139. 'search' => array
  140. (
  141. # 匹配的正则或函数 选填项
  142. 'option' => array
  143. (
  144. 'ids' => array('yes-id', 'in'),
  145. 'cate_id' => 'yes',
  146. 'name' => array('yes', 'like'),
  147. 'id' => 'yes',
  148. 'state' => 1,
  149. ),
  150. 'type' => 'all',
  151. 'order' => array('reorder' => 'desc', 'cdate' => 'desc'),
  152. 'limit' => '0,10',
  153. 'col' => 'name as name, id, id as value, "" as selected, "" as disabled|id',
  154. ),
  155. 'getFive' => array
  156. (
  157. # 匹配的正则或函数 选填项
  158. 'option' => array
  159. (
  160. 'state' => 1,
  161. ),
  162. 'type' => 'all',
  163. 'order' => array('reorder' => 'desc', 'cdate' => 'desc'),
  164. 'limit' => '0,5',
  165. 'col' => '*',
  166. ),
  167. ),
  168. );