account.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <?php
  2. /**
  3. * user
  4. */
  5. # 定义几个常用的选项
  6. $option = array
  7. (
  8. 1 => '正常',
  9. 2 => '冻结',
  10. );
  11. $group = function()
  12. {
  13. $array = array();
  14. $data = Dever::load('weixin/group-main');
  15. if($data)
  16. {
  17. $array += $data;
  18. }
  19. return $array;
  20. };
  21. return array
  22. (
  23. # 表名
  24. 'name' => 'account',
  25. # 显示给用户看的名称
  26. 'lang' => '客服管理',
  27. 'desc' => '注意:多客服功能,如果您仅有一个客服,则可不需要使用此功能',
  28. 'menu' => false,
  29. 'start' => array
  30. (
  31. # 更新客服信息到微信
  32. 'insert' => 'weixin/account.insert',
  33. # 更新客服信息到微信
  34. 'update' => 'weixin/account.update',
  35. # 更新客服信息到微信
  36. 'delete' => 'weixin/account.delete',
  37. ),
  38. # 数据结构
  39. 'struct' => array
  40. (
  41. 'id' => array
  42. (
  43. 'type' => 'int-11',
  44. 'name' => 'ID',
  45. 'default' => '',
  46. 'desc' => '',
  47. 'match' => 'is_numeric',
  48. //'search' => 'order',
  49. //'list' => true,
  50. ),
  51. 'site' => array
  52. (
  53. 'type' => 'int-11',
  54. 'name' => '站点',
  55. 'default' => '',
  56. 'desc' => '请输入站点',
  57. 'match' => 'is_numeric',
  58. ),
  59. 'account' => array
  60. (
  61. 'type' => 'varchar-50',
  62. 'name' => '客服账号',
  63. 'default' => '',
  64. 'desc' => '请输入客服账号',
  65. 'match' => 'is_string',
  66. 'search' => 'order,fulltext',
  67. //'update' => 'text',
  68. 'list' => true,
  69. ),
  70. 'nickname' => array
  71. (
  72. 'type' => 'varchar-50',
  73. 'name' => '昵称',
  74. 'default' => '',
  75. 'desc' => '请输入昵称',
  76. 'match' => 'is_string',
  77. 'search' => 'fulltext',
  78. //'update' => 'text',
  79. 'list' => true,
  80. ),
  81. 'groupid' => array
  82. (
  83. 'type' => 'int-11',
  84. 'name' => '分组(设置之后该客服只能回复该分组的用户消息)',
  85. 'default' => '0',
  86. 'desc' => '请选择分组',
  87. 'match' => 'option',
  88. 'option' => $group,
  89. 'search' => 'select',
  90. 'update' => 'radio',
  91. 'list' => true,
  92. ),
  93. 'pic' => array
  94. (
  95. 'type' => 'varchar-150',
  96. 'name' => '头像(640X640)',
  97. 'default' => '',
  98. 'desc' => '请选择头像',
  99. 'match' => 'option',
  100. 'update' => 'image',
  101. 'key' => '1',
  102. 'place' => '640X640',
  103. ),
  104. 'state' => array
  105. (
  106. 'type' => 'tinyint-1',
  107. 'name' => '状态',
  108. 'default' => '1',
  109. 'desc' => '请选择状态',
  110. 'match' => array('is_numeric', 1),
  111. 'option' => $option,
  112. //'update' => 'radio',
  113. 'list' => true,
  114. ),
  115. 'cdate' => array
  116. (
  117. 'type' => 'int-11',
  118. 'name' => '录入时间',
  119. 'match' => array('is_numeric', time()),
  120. 'desc' => '',
  121. # 只有insert时才生效
  122. 'insert' => true,
  123. ),
  124. ),
  125. 'manage' => array
  126. (
  127. //'list_button' => array(6 => '同步'),
  128. 'button' => array
  129. (
  130. //'重新同步' => 'manage/api.update',
  131. )
  132. ),
  133. # 后台新增功能,权限精细控制 他的值为需要控制的字段
  134. 'auth' => 'site',
  135. # request 请求接口定义
  136. 'request' => array
  137. (
  138. # 根据hash取一条数据
  139. 'info' => array
  140. (
  141. # 匹配的正则或函数 必填项
  142. 'where' => array
  143. (
  144. 'site' => 'yes',
  145. 'openid' => 'yes',
  146. ),
  147. 'type' => 'one',
  148. ),
  149. # 根据unionid 获取信息
  150. 'getOne' => array
  151. (
  152. # 匹配的正则或函数 必填项
  153. 'where' => array
  154. (
  155. 'site' => 'yes',
  156. 'unionid' => 'yes',
  157. ),
  158. 'type' => 'one',
  159. ),
  160. # 改变订阅状态
  161. 'upSubscribe' => array
  162. (
  163. 'type' => 'update',
  164. 'where' => array
  165. (
  166. 'openid' => 'yes',
  167. 'site' => 'yes',
  168. ),
  169. 'set' => array
  170. (
  171. 'subscribe' => 'yes',
  172. ),
  173. ),
  174. ),
  175. );