wechat.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <?php
  2. $type = array
  3. (
  4. 1 => '小程序',
  5. 2 => '微信公众号',
  6. 3 => 'IOS微信客户端',
  7. 4 => '安卓微信客户端',
  8. );
  9. return array
  10. (
  11. # 表名
  12. 'name' => 'wechat',
  13. # 显示给用户看的名称
  14. 'lang' => '微信绑定列表',
  15. 'order' => 10,
  16. 'menu' => false,
  17. # 数据结构
  18. 'struct' => array
  19. (
  20. 'id' => array
  21. (
  22. 'type' => 'int-11',
  23. 'name' => 'ID',
  24. 'default' => '',
  25. 'desc' => '',
  26. 'match' => 'is_numeric',
  27. //'search' => 'order',
  28. 'order' => 'desc',
  29. 'list' => true,
  30. ),
  31. 'system_id' => array
  32. (
  33. 'type' => 'int-11',
  34. 'name' => '所属项目',
  35. 'default' => '1',
  36. 'desc' => '所属项目',
  37. 'match' => 'is_numeric',
  38. //'option' => $level,
  39. //'update' => 'select',
  40. //'list' => true,
  41. ),
  42. 'uid' => array
  43. (
  44. 'type' => 'int-11',
  45. 'name' => '用户',
  46. 'default' => '',
  47. 'desc' => '',
  48. 'match' => 'is_numeric',
  49. //'update' => 'select',
  50. 'search' => 'fulltext',
  51. 'list' => '{uid} > 0 ? Dever::load("passport/user-one#username", {uid}) : "未知用户"',
  52. 'list' => true,
  53. //'edit' => true,
  54. ),
  55. 'type' => array
  56. (
  57. 'type' => 'tinyint-1',
  58. 'name' => '类型',
  59. 'default' => '1',
  60. 'desc' => '类型',
  61. 'match' => 'is_numeric',
  62. 'option' => $type,
  63. 'update' => 'radio',
  64. 'list' => true,
  65. ),
  66. 'openid' => array
  67. (
  68. 'type' => 'varchar-50',
  69. 'name' => 'openid-微信的唯一用户id',
  70. 'default' => '',
  71. 'desc' => 'openid',
  72. 'match' => 'is_string',
  73. //'update' => 'text',
  74. 'search' => 'fulltext',
  75. 'list' => true,
  76. ),
  77. 'unionid' => array
  78. (
  79. 'type' => 'varchar-50',
  80. 'name' => 'unionid-微信的唯一用户id',
  81. 'default' => '',
  82. 'desc' => 'unionid',
  83. 'match' => 'is_string',
  84. //'update' => 'text',
  85. 'search' => 'fulltext',
  86. 'list' => true,
  87. ),
  88. 'session_key' => array
  89. (
  90. 'type' => 'varchar-50',
  91. 'name' => 'session_key',
  92. 'default' => '',
  93. 'desc' => 'session_key',
  94. 'match' => 'is_string',
  95. //'update' => 'text',
  96. ),
  97. 'access_token' => array
  98. (
  99. 'type' => 'varchar-200',
  100. 'name' => 'access_token',
  101. 'default' => '',
  102. 'desc' => 'access_token',
  103. 'match' => 'is_string',
  104. //'update' => 'text',
  105. ),
  106. 'refresh_token' => array
  107. (
  108. 'type' => 'varchar-200',
  109. 'name' => 'refresh_token',
  110. 'default' => '',
  111. 'desc' => 'refresh_token',
  112. 'match' => 'is_string',
  113. //'update' => 'text',
  114. ),
  115. 'expires_in' => array
  116. (
  117. 'type' => 'varchar-100',
  118. 'name' => 'expires_in',
  119. 'default' => '',
  120. 'desc' => 'expires_in',
  121. 'match' => 'is_string',
  122. //'update' => 'text',
  123. ),
  124. 'state' => array
  125. (
  126. 'type' => 'tinyint-1',
  127. 'name' => '状态',
  128. 'default' => '1',
  129. 'desc' => '请选择状态',
  130. 'match' => 'is_numeric',
  131. ),
  132. 'cdate' => array
  133. (
  134. 'type' => 'int-11',
  135. 'name' => '录入时间',
  136. 'match' => array('is_numeric', time()),
  137. 'desc' => '',
  138. # 只有insert时才生效
  139. 'search' => 'date',
  140. 'insert' => true,
  141. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  142. ),
  143. ),
  144. 'manage' => array
  145. (
  146. 'insert' => false,
  147. 'edit' => false,
  148. 'delete' => false,
  149. ),
  150. # request 请求接口定义
  151. 'request' => array
  152. (
  153. ),
  154. );