account_msg.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <?php
  2. $option = array
  3. (
  4. 1 => '发送成功',
  5. 2 => '发送失败',
  6. );
  7. $type = array
  8. (
  9. 'text' => '文本',
  10. 'voice' => '语音',
  11. 'video' => '视频',
  12. 'image' => '图片',
  13. );
  14. return array
  15. (
  16. # 表名
  17. 'name' => 'account_msg',
  18. # 显示给用户看的名称
  19. 'lang' => '客服点对点消息',
  20. 'menu' => false,
  21. # 数据结构
  22. 'struct' => array
  23. (
  24. 'id' => array
  25. (
  26. 'type' => 'int-11',
  27. 'name' => 'ID',
  28. 'default' => '',
  29. 'desc' => '',
  30. 'match' => 'is_numeric',
  31. 'search' => 'order',
  32. //'list' => true,
  33. ),
  34. 'site' => array
  35. (
  36. 'type' => 'int-11',
  37. 'name' => '站点',
  38. 'default' => '',
  39. 'desc' => '请输入站点',
  40. 'match' => 'is_numeric',
  41. ),
  42. 'openid' => array
  43. (
  44. 'type' => 'varchar-100',
  45. 'name' => '接收人',
  46. 'default' => '',
  47. 'desc' => '接收人',
  48. 'search' => 'fulltext',
  49. 'list' => 'Dever::load("weixin/user.name", "{openid}")',
  50. 'match' => 'option',
  51. ),
  52. 'account' => array
  53. (
  54. 'type' => 'int-11',
  55. 'name' => '客服',
  56. 'default' => '',
  57. 'desc' => '客服',
  58. 'search' => 'fulltext',
  59. //'list' => true,
  60. 'match' => 'option',
  61. ),
  62. 'type' => array
  63. (
  64. 'type' => 'varchar-20',
  65. 'name' => '发送类型',
  66. 'default' => '',
  67. 'desc' => '发送类型',
  68. 'search' => 'select',
  69. 'list' => true,
  70. 'option' => $type,
  71. 'match' => 'option',
  72. ),
  73. 'usermsg_id' => array
  74. (
  75. 'type' => 'int-11',
  76. 'name' => '消息id',
  77. 'default' => '',
  78. 'desc' => '消息id',
  79. 'search' => 'fulltext',
  80. //'list' => true,
  81. 'match' => 'option',
  82. ),
  83. 'info' => array
  84. (
  85. 'type' => 'text-255',
  86. 'name' => '消息内容',
  87. 'default' => '',
  88. 'desc' => '消息内容',
  89. 'search' => 'fulltext',
  90. 'list' => true,
  91. 'match' => 'option',
  92. ),
  93. 'state' => array
  94. (
  95. 'type' => 'tinyint-1',
  96. 'name' => '状态',
  97. 'default' => '1',
  98. 'desc' => '请选择状态',
  99. 'match' => array('is_numeric', 1),
  100. 'option' => $option,
  101. 'update' => 'radio',
  102. //'list' => true,
  103. ),
  104. 'cdate' => array
  105. (
  106. 'type' => 'int-11',
  107. 'name' => '录入时间',
  108. 'match' => array('is_numeric', time()),
  109. 'desc' => '',
  110. # 只有insert时才生效
  111. 'insert' => true,
  112. ),
  113. ),
  114. 'manage' => array
  115. (
  116. 'desc' => '注:这里的记录为用户发送给本公众号的消息',
  117. ),
  118. 'auth' => 'site',
  119. # request 请求接口定义
  120. 'request' => array
  121. (
  122. 'getOne' => array
  123. (
  124. # 匹配的正则或函数 必填项
  125. 'where' => array
  126. (
  127. 'openid' => 'yes',
  128. 'site' => 'yes',
  129. ),
  130. 'type' => 'one',
  131. 'order' => array('cdate', 'desc'),
  132. ),
  133. 'getAll' => array
  134. (
  135. # 匹配的正则或函数 必填项
  136. 'where' => array
  137. (
  138. 'openid' => 'yes',
  139. 'site' => 'yes',
  140. ),
  141. 'type' => 'all',
  142. 'order' => array('cdate', 'desc'),
  143. 'col' => '*|usermsg_id|id|',
  144. ),
  145. ),
  146. );