wechat.php 3.3 KB

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