subscribe.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <?php
  2. $type = array
  3. (
  4. //1 => '保留',
  5. 2 => '一次性订阅',
  6. 3 => '长期订阅',
  7. );
  8. return array
  9. (
  10. # 表名
  11. 'name' => 'subscribe',
  12. # 显示给用户看的名称
  13. 'lang' => '订阅消息列表',
  14. 'order' => 89,
  15. 'desc' => Dever::markdown('发送模板消息接口:'.Dever::url("wechat_applet/subscribe.send").'
  16. key:消息key
  17. project_id:项目id
  18. touser:用户openid
  19. page:页面路径
  20. data:内容
  21. miniprogram_state:developer为开发版;trial为体验版;formal为正式版;默认为正式版
  22. '),
  23. # 数据结构
  24. 'struct' => array
  25. (
  26. 'id' => array
  27. (
  28. 'type' => 'int-11',
  29. 'name' => 'ID',
  30. 'default' => '',
  31. 'desc' => '',
  32. 'match' => 'is_numeric',
  33. 'search' => 'order',
  34. //'list' => true,
  35. ),
  36. 'project_id' => array
  37. (
  38. 'type' => 'int-11',
  39. 'name' => '项目ID',
  40. 'default' => '',
  41. 'desc' => '请输入项目',
  42. 'match' => 'is_numeric',
  43. 'list' => 'Dever::load("token/project-one#name", {project_id})',
  44. ),
  45. 'name' => array
  46. (
  47. 'type' => 'varchar-120',
  48. 'name' => '标题',
  49. 'default' => '',
  50. 'desc' => '标题',
  51. 'match' => 'is_string',
  52. 'update' => 'text',
  53. 'list' => true,
  54. ),
  55. 'type' => array
  56. (
  57. 'type' => 'tinyint-1',
  58. 'name' => '订阅类型',
  59. 'default' => '1',
  60. 'desc' => '订阅类型',
  61. 'match' => 'is_numeric',
  62. 'update' => 'radio',
  63. 'option' => $type,
  64. 'list' => true,
  65. ),
  66. 'key' => array
  67. (
  68. 'type' => 'varchar-20',
  69. 'name' => '消息key-通过key值搜索数据',
  70. 'default' => '',
  71. 'desc' => '消息key-通过key值搜索数据',
  72. 'match' => 'is_string',
  73. 'update' => 'text',
  74. 'list' => true,
  75. 'edit' => true,
  76. ),
  77. 'template_id' => array
  78. (
  79. 'type' => 'varchar-120',
  80. 'name' => '模板id',
  81. 'default' => '',
  82. 'desc' => '模板id',
  83. 'match' => 'is_string',
  84. //'update' => 'text',
  85. //'list' => true,
  86. ),
  87. 'content' => array
  88. (
  89. 'type' => 'varchar-600',
  90. 'name' => '内容',
  91. 'default' => '',
  92. 'desc' => '内容',
  93. 'match' => 'option',
  94. //'update' => 'textarea',
  95. 'list' => true,
  96. ),
  97. 'example' => array
  98. (
  99. 'type' => 'varchar-600',
  100. 'name' => '样例',
  101. 'default' => '',
  102. 'desc' => '样例',
  103. 'match' => 'option',
  104. //'update' => 'textarea',
  105. 'list' => true,
  106. 'modal' => '点此查看',
  107. ),
  108. 'state' => array
  109. (
  110. 'type' => 'tinyint-1',
  111. 'name' => '状态',
  112. 'default' => '1',
  113. 'desc' => '请选择状态',
  114. 'match' => 'is_numeric',
  115. ),
  116. 'cdate' => array
  117. (
  118. 'type' => 'int-11',
  119. 'name' => '更新时间',
  120. 'match' => array('is_numeric', time()),
  121. 'desc' => '',
  122. 'default' => '',
  123. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  124. ),
  125. ),
  126. //'top' => Dever::config('base', 'wechat_applet')->top,
  127. 'manage' => array
  128. (
  129. //'delete' => false,
  130. 'insert' => false,
  131. //'edit' => false,
  132. 'button' => array
  133. (
  134. '同步订阅模板' => 'wechat_applet/subscribe.sync',
  135. ),
  136. ),
  137. 'request' => array
  138. (
  139. 'getAll' => array
  140. (
  141. # 匹配的正则或函数 选填项
  142. 'option' => array
  143. (
  144. 'project_id' => 'yes',
  145. 'key' => array('yes', 'like'),
  146. 'state' => 1,
  147. ),
  148. 'type' => 'all',
  149. 'order' => array('cdate' => 'desc'),
  150. 'limit' => '0,3',
  151. 'col' => '*',
  152. ),
  153. )
  154. );