news.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <?php
  2. $status = Dever::config('base')->status;
  3. # 每页的数据量
  4. $page = 15;
  5. $share = array
  6. (
  7. 1 => '显示',
  8. 2 => '不显示',
  9. );
  10. # 常用的col
  11. $col = '*';
  12. return array
  13. (
  14. # 表名
  15. 'name' => 'news',
  16. # 显示给用户看的名称
  17. 'lang' => '图文内容',
  18. 'order' => 100,
  19. 'menu' => false,
  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. 'list' => true,
  31. ),
  32. 'info_id' => array
  33. (
  34. 'type' => 'int-11',
  35. 'name' => '合集',
  36. 'default' => '',
  37. 'desc' => '合集',
  38. 'match' => 'is_numeric',
  39. 'update' => 'text',
  40. 'value' => Dever::input('search_option_info_id')
  41. ),
  42. 'content_id' => array
  43. (
  44. 'type' => 'int-11',
  45. 'name' => '合集内容id',
  46. 'default' => '',
  47. 'desc' => '合集内容id',
  48. 'match' => 'is_numeric',
  49. 'update' => 'text',
  50. 'value' => Dever::input('search_option_content_id')
  51. ),
  52. 'name' => array
  53. (
  54. 'type' => 'varchar-80',
  55. 'name' => '标题-图文标题',
  56. 'default' => '',
  57. 'desc' => '标题',
  58. 'match' => 'is_string',
  59. 'update' => 'text',
  60. 'list' => true,
  61. 'search' => 'fulltext',
  62. //增加预览
  63. 'preview' => true,
  64. ),
  65. 'desc' => array
  66. (
  67. 'type' => 'varchar-500',
  68. 'name' => '摘要-图文摘要',
  69. 'default' => '',
  70. 'desc' => '摘要',
  71. 'match' => 'is_string',
  72. 'update' => 'textarea',
  73. ),
  74. 'pic' => array
  75. (
  76. 'type' => 'varchar-150',
  77. 'name' => '1:1封面图-图片尺寸380*380px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式,同时用于分享图片',
  78. 'default' => '',
  79. 'desc' => '封面图',
  80. 'match' => 'is_string',
  81. 'update' => 'image',
  82. 'key' => '1',
  83. 'place' => '150',
  84. ),
  85. 'pdate' => array
  86. (
  87. 'type' => 'int-11',
  88. 'name' => '发布时间',
  89. 'match' => array('is_numeric', time()),
  90. 'default' => '',
  91. 'desc' => '',
  92. 'update' => 'date',
  93. 'callback' => 'maketime',
  94. 'insert' => true,
  95. //'list' => 'date("Y-m-d H:i:s", {pdate})',
  96. 'auth' => '"{pdate}" > 0',
  97. ),
  98. 'udate' => array
  99. (
  100. 'type' => 'int-11',
  101. 'name' => '更新时间',
  102. 'match' => array('is_numeric', time()),
  103. 'desc' => '',
  104. ),
  105. 'content' => array
  106. (
  107. 'type' => 'text-255',
  108. 'name' => '内容',
  109. 'default' => '',
  110. 'desc' => '请输入内容',
  111. 'match' => 'is_string',
  112. 'update' => 'editor',
  113. 'key' => '1',
  114. ),
  115. 'status' => array
  116. (
  117. 'type' => 'int-11',
  118. 'name' => '发布状态',
  119. 'default' => '2',
  120. 'desc' => '发布状态',
  121. 'match' => 'is_numeric',
  122. //'update' => 'select',
  123. 'option' => $status,
  124. 'search' => 'select',
  125. 'list' => true,
  126. 'edit' => true,
  127. ),
  128. 'reorder' => array
  129. (
  130. 'type' => 'int-11',
  131. 'name' => '排序(数值越大越靠前)',
  132. 'default' => '1',
  133. 'desc' => '请输入排序',
  134. 'match' => 'option',
  135. //'update' => 'text',
  136. 'search' => 'order',
  137. 'list' => true,
  138. 'order' => 'desc',
  139. 'edit' => true,
  140. ),
  141. 'state' => array
  142. (
  143. 'type' => 'tinyint-1',
  144. 'name' => '状态',
  145. 'default' => '1',
  146. 'desc' => '请选择状态',
  147. 'match' => 'is_numeric',
  148. ),
  149. 'cdate' => array
  150. (
  151. 'type' => 'int-11',
  152. 'name' => '录入时间',
  153. 'match' => array('is_numeric', time()),
  154. 'desc' => '',
  155. # 只有insert时才生效
  156. 'insert' => true,
  157. ),
  158. ),
  159. # 管理功能
  160. 'manage' => array
  161. (
  162. //'insert' => false,
  163. # 列表
  164. 'list_buttons' => array
  165. (
  166. 'edit' => array('预览', str_replace('https://api.', 'http://www.', Dever::url('main/preview.get?type=1'))),
  167. ),
  168. ),
  169. # request 请求接口定义
  170. 'request' => array
  171. (
  172. ),
  173. );