wechat.php 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <?php
  2. $cate = function()
  3. {
  4. $array = array();
  5. $info = Dever::db('content/cate')->state();
  6. if($info)
  7. {
  8. $array += $info;
  9. }
  10. return $array;
  11. };
  12. $author = function()
  13. {
  14. $array = array();
  15. $info = Dever::db('content/author')->state();
  16. if($info)
  17. {
  18. $array += $info;
  19. }
  20. return $array;
  21. };
  22. return array
  23. (
  24. # 表名
  25. 'name' => 'wechat',
  26. # 显示给用户看的名称
  27. 'lang' => '公众号管理',
  28. # 后台菜单排序
  29. 'order' => 10,
  30. # 数据结构
  31. 'struct' => array
  32. (
  33. 'id' => array
  34. (
  35. 'type' => 'int-11',
  36. 'name' => 'ID',
  37. 'default' => '',
  38. 'desc' => '',
  39. 'match' => 'is_numeric',
  40. 'search' => 'order',
  41. //'list' => true,
  42. 'order' => 'desc',
  43. ),
  44. 'name' => array
  45. (
  46. 'type' => 'varchar-100',
  47. 'name' => '名称-直接输入公众号名称即可,系统会自动抓取该公众号的最新10篇文章',
  48. 'default' => '',
  49. 'desc' => '请输入名称',
  50. 'match' => 'is_string',
  51. 'update' => 'text',
  52. 'search' => 'fulltext',
  53. 'list' => true,
  54. ),
  55. 'wechat' => array
  56. (
  57. 'type' => 'varchar-200',
  58. 'name' => '微信号',
  59. 'default' => '',
  60. 'desc' => '微信号',
  61. 'match' => 'is_string',
  62. //'update' => 'text',
  63. 'search' => 'fulltext',
  64. 'list' => true,
  65. ),
  66. 'cate_id' => array
  67. (
  68. 'type' => 'int-11',
  69. 'name' => '所属栏目',
  70. 'default' => '1',
  71. 'desc' => '所属栏目',
  72. 'match' => 'is_numeric',
  73. 'update' => 'select',
  74. 'option' => $cate,
  75. 'search' => 'select',
  76. 'list' => true,
  77. 'edit' => true,
  78. ),
  79. 'author_id' => array
  80. (
  81. 'type' => 'int-11',
  82. 'name' => '作者',
  83. 'default' => '1',
  84. 'desc' => '作者',
  85. 'match' => 'is_numeric',
  86. 'update' => 'select',
  87. 'option' => $author,
  88. 'search' => 'select',
  89. 'list' => true,
  90. 'edit' => true,
  91. ),
  92. 'zdate' => array
  93. (
  94. 'type' => 'int-11',
  95. 'name' => '下次执行时间',
  96. 'match' => 'is_numeric',
  97. 'desc' => '请选择执行时间',
  98. 'default' => '',
  99. 'update' => 'date',
  100. 'callback' => 'maketime',
  101. 'list' => '{zdate} > 0 ? date("Y-m-d H:i:s", {zdate}) : "未知"',
  102. ),
  103. 'pdate' => array
  104. (
  105. 'type' => 'int-11',
  106. 'name' => '抓取时间间隔-每个公众号发布的文章时间不同,请设置抓取时间间隔,单位为小时,尽量保证每次抓取都有新数据,也请不要设置间隔时间太短,抓取太频繁会导致抓取失败',
  107. 'match' => 'is_numeric',
  108. 'default' => '12',
  109. 'desc' => '',
  110. 'update' => 'text',
  111. 'list' => true,
  112. ),
  113. 'reorder' => array
  114. (
  115. 'type' => 'int-11',
  116. 'name' => '排序(数值越大越靠前)',
  117. 'default' => '1',
  118. 'desc' => '请输入排序',
  119. 'match' => 'option',
  120. //'update' => 'text',
  121. 'search' => 'order',
  122. //'list' => true,
  123. 'order' => 'desc',
  124. 'edit' => true,
  125. ),
  126. 'state' => array
  127. (
  128. 'type' => 'tinyint-1',
  129. 'name' => '状态',
  130. 'default' => '1',
  131. 'desc' => '请选择状态',
  132. 'match' => 'is_numeric',
  133. ),
  134. 'cdate' => array
  135. (
  136. 'type' => 'int-11',
  137. 'name' => '录入时间',
  138. 'match' => array('is_numeric', time()),
  139. 'desc' => '',
  140. # 只有insert时才生效
  141. 'insert' => true,
  142. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  143. ),
  144. ),
  145. # 默认值
  146. 'default' => array
  147. (
  148. ),
  149. 'manage' => array
  150. (
  151. ),
  152. # request 请求接口定义
  153. 'request' => array
  154. (
  155. # get
  156. 'get' => array
  157. (
  158. 'where' => array
  159. (
  160. 'zdate' => array('yes', '<='),
  161. 'state' => 1,
  162. ),
  163. 'type' => 'all',
  164. 'order' => array('id', 'desc'),
  165. 'col' => '*',
  166. ),
  167. ),
  168. );