code.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <?php
  2. $message = function()
  3. {
  4. $array = array(-1 => array('name' => '不选择消息'));
  5. $data = Dever::load('weixin/content-get_2');
  6. if($data)
  7. {
  8. $array += $data;
  9. }
  10. return $array;
  11. };
  12. # 时效类型
  13. $type = array
  14. (
  15. 'QR_SCENE' => '临时二维码(有效期7天)',
  16. 'QR_LIMIT_SCENE' => '永久二维码',
  17. );
  18. $code = 'https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=';
  19. return array
  20. (
  21. # 表名
  22. 'name' => 'code',
  23. # 显示给用户看的名称
  24. 'lang' => '二维码管理',
  25. 'order' => 15,
  26. 'end' => array
  27. (
  28. # 生成二维码
  29. 'insert' => 'weixin/code.update',
  30. ),
  31. # 数据结构
  32. 'struct' => array
  33. (
  34. 'id' => array
  35. (
  36. 'type' => 'int-11',
  37. 'name' => 'ID',
  38. 'default' => '',
  39. 'desc' => '',
  40. 'match' => 'is_numeric',
  41. //'search' => 'order',
  42. //'list' => true,
  43. ),
  44. 'site' => array
  45. (
  46. 'type' => 'int-11',
  47. 'name' => '站点',
  48. 'default' => '',
  49. 'desc' => '请输入站点',
  50. 'match' => 'is_numeric',
  51. ),
  52. 'name' => array
  53. (
  54. 'type' => 'varchar-32',
  55. 'name' => '二维码渠道描述',
  56. 'default' => '',
  57. 'desc' => '请输入二维码渠道描述',
  58. 'match' => 'is_string',
  59. 'update' => 'text',
  60. 'search' => 'order,fulltext',
  61. 'list' => true,
  62. ),
  63. 'ticket' => array
  64. (
  65. 'type' => 'varchar-100',
  66. 'name' => '二维码',
  67. 'default' => '',
  68. 'desc' => '请输入二维码',
  69. 'match' => 'option',
  70. //'update' => 'text',
  71. 'list' => '"<a href='.$code.'".urlencode(\'{ticket}\')." target=_blank><img width=100 height=100 src='.$code.'".urlencode(\'{ticket}\')."></a>"',
  72. ),
  73. 'type' => array
  74. (
  75. 'type' => 'varchar-15',
  76. 'name' => '时效类型',
  77. 'default' => 'QR_LIMIT_SCENE',
  78. 'desc' => '请选择时效类型',
  79. 'match' => 'is_string',
  80. 'option' => $type,
  81. 'update' => 'select',
  82. 'list' => true,
  83. 'show' => 'yes',
  84. ),
  85. 'message' => array
  86. (
  87. 'type' => 'int-11',
  88. 'name' => '回复消息(选填)',
  89. 'default' => '',
  90. 'desc' => '回复消息',
  91. 'match' => 'option',
  92. 'update' => 'select',
  93. 'list' => '{message} > 0 ? Dever::load("weixin/content-one#keywords", {message}) : "未选择消息"',
  94. 'option' => $message,
  95. 'show' => 'yes',
  96. ),
  97. 'expire' => array
  98. (
  99. 'type' => 'varchar-20',
  100. 'name' => '有效时间',
  101. 'default' => '',
  102. 'desc' => '请输入有效时间',
  103. 'match' => 'option',
  104. ),
  105. 'url' => array
  106. (
  107. 'type' => 'varchar-150',
  108. 'name' => '源地址',
  109. 'default' => '',
  110. 'desc' => '请输入源地址',
  111. 'match' => 'option',
  112. 'list' => 'table',
  113. 'modal' => '查看详情',
  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. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  124. ),
  125. ),
  126. 'auth' => 'site',
  127. 'manage' => array
  128. (
  129. 'desc' => '1、临时二维码,是有过期时间的,最长可以设置为在二维码生成后的7天(即604800秒)后过期,但能够生成较多数量。临时二维码主要用于帐号绑定等不要求二维码永久保存的业务场景
  130. <br />2、永久二维码,是无过期时间的,但数量较少(目前为最多10万个)。永久二维码主要用于适用于帐号绑定、用户来源统计等场景。<br />注意:在扫描二维码订阅时,不选择回复消息,系统将默认使用“订阅消息回复”规则',
  131. ),
  132. );