feature.php 4.6 KB

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