material.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <?php
  2. $type = array
  3. (
  4. 1 => '图文',
  5. );
  6. return array
  7. (
  8. # 表名
  9. 'name' => 'material',
  10. # 显示给用户看的名称
  11. 'lang' => '素材列表',
  12. 'order' => 100,
  13. 'desc' => '请将material.cron放到cron中,项目选择公众号',
  14. # 数据结构
  15. 'struct' => array
  16. (
  17. 'id' => array
  18. (
  19. 'type' => 'int-11',
  20. 'name' => 'ID',
  21. 'default' => '',
  22. 'desc' => '',
  23. 'match' => 'is_numeric',
  24. 'search' => 'order',
  25. //'list' => true,
  26. ),
  27. 'project_id' => array
  28. (
  29. 'type' => 'int-11',
  30. 'name' => '项目',
  31. 'default' => '',
  32. 'desc' => '请输入项目',
  33. 'match' => 'is_numeric',
  34. 'list' => 'Dever::load("main/project-one#name", {project_id})',
  35. ),
  36. 'type' => array
  37. (
  38. 'type' => 'tinyint-1',
  39. 'name' => '类型',
  40. 'default' => '1',
  41. 'desc' => '类型',
  42. 'match' => 'is_numeric',
  43. 'update' => 'select',
  44. 'search' => 'select',
  45. 'option' => $type,
  46. 'list' => true,
  47. ),
  48. 'media_id' => array
  49. (
  50. 'type' => 'varchar-50',
  51. 'name' => '素材id-相同素材id为一组',
  52. 'default' => '',
  53. 'desc' => '素材id',
  54. 'match' => 'is_string',
  55. //'update' => 'text',
  56. //'list' => true,
  57. ),
  58. 'index' => array
  59. (
  60. 'type' => 'int-11',
  61. 'name' => '同组素材的key',
  62. 'default' => '',
  63. 'desc' => '同组素材的key',
  64. 'match' => 'is_string',
  65. //'update' => 'text',
  66. //'list' => true,
  67. ),
  68. 'name' => array
  69. (
  70. 'type' => 'varchar-120',
  71. 'name' => '标题-对应微信的title',
  72. 'default' => '',
  73. 'desc' => '标题',
  74. 'match' => 'is_string',
  75. 'update' => 'text',
  76. 'search' => 'fulltext',
  77. 'list' => '"{name}:{index}"',
  78. //'modal' => '"{name}"',
  79. ),
  80. 'author' => array
  81. (
  82. 'type' => 'varchar-120',
  83. 'name' => '作者',
  84. 'default' => '',
  85. 'desc' => '作者',
  86. 'match' => 'option',
  87. 'update' => 'text',
  88. 'list' => true,
  89. ),
  90. 'desc' => array
  91. (
  92. 'type' => 'varchar-500',
  93. 'name' => '摘要-对应微信的digest',
  94. 'default' => '',
  95. 'desc' => '摘要',
  96. 'match' => 'option',
  97. 'update' => 'textarea',
  98. //'list' => true,
  99. ),
  100. 'url' => array
  101. (
  102. 'type' => 'varchar-500',
  103. 'name' => '链接-微信链接',
  104. 'default' => '',
  105. 'desc' => '链接',
  106. 'match' => 'option',
  107. 'update' => 'text',
  108. //'list' => true,
  109. ),
  110. 'content_source_url' => array
  111. (
  112. 'type' => 'varchar-500',
  113. 'name' => '原文页链接',
  114. 'default' => '',
  115. 'desc' => '原文页链接',
  116. 'match' => 'option',
  117. 'update' => 'text',
  118. //'list' => true,
  119. ),
  120. 'thumb_media_id' => array
  121. (
  122. 'type' => 'varchar-50',
  123. 'name' => '封面图片素材id',
  124. 'default' => '',
  125. 'desc' => '封面图片素材id',
  126. 'match' => 'is_string',
  127. //'update' => 'text',
  128. //'list' => true,
  129. ),
  130. 'thumb_url' => array
  131. (
  132. 'type' => 'varchar-150',
  133. 'name' => '封面',
  134. 'default' => '',
  135. 'desc' => '请选择封面',
  136. 'match' => 'option',
  137. 'update' => 'image',
  138. 'key' => '1',
  139. 'place' => '150',
  140. ),
  141. 'content' => array
  142. (
  143. 'type' => 'longtext',
  144. 'name' => '内容',
  145. 'default' => '',
  146. 'desc' => '内容',
  147. 'match' => 'option',
  148. 'update' => 'editor',
  149. //'list' => true,
  150. ),
  151. 'update_time' => array
  152. (
  153. 'type' => 'int-11',
  154. 'name' => '更新时间',
  155. 'match' => 'is_numeric',
  156. 'desc' => '',
  157. 'default' => '',
  158. 'list' => 'date("Y-m-d H:i:s", {update_time})',
  159. ),
  160. 'create_time' => array
  161. (
  162. 'type' => 'int-11',
  163. 'name' => '创建时间',
  164. 'match' => 'is_numeric',
  165. 'desc' => '',
  166. 'default' => '',
  167. //'list' => 'date("Y-m-d H:i:s", {create_time})',
  168. ),
  169. 'state' => array
  170. (
  171. 'type' => 'tinyint-1',
  172. 'name' => '状态',
  173. 'default' => '1',
  174. 'desc' => '请选择状态',
  175. 'match' => 'is_numeric',
  176. ),
  177. 'cdate' => array
  178. (
  179. 'type' => 'int-11',
  180. 'name' => '更新时间',
  181. 'match' => array('is_numeric', time()),
  182. 'desc' => '',
  183. 'default' => '',
  184. # 只有insert时才生效
  185. 'insert' => true,
  186. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  187. ),
  188. ),
  189. 'manage' => array
  190. (
  191. //'delete' => false,
  192. //'insert' => false,
  193. //'edit' => false,
  194. 'button' => array
  195. (
  196. '获取最新图文' => 'service/material.get',
  197. ),
  198. ),
  199. );