media.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <?php
  2. /**
  3. * 素材库
  4. */
  5. $type = array
  6. (
  7. 'image' => '图片',
  8. 'voice' => '语音',
  9. 'video' => '视频',
  10. 'thead' => '图文',
  11. 'thumb' => '缩略图',
  12. );
  13. return array
  14. (
  15. # 表名
  16. 'name' => 'media',
  17. # 显示给用户看的名称
  18. 'lang' => '多媒体素材管理',
  19. # 数据结构
  20. 'struct' => array
  21. (
  22. 'id' => array
  23. (
  24. 'type' => 'int-11',
  25. 'name' => 'ID',
  26. 'default' => '',
  27. 'desc' => '',
  28. 'match' => 'is_numeric',
  29. 'search' => 'order',
  30. 'list' => true,
  31. ),
  32. 'site' => array
  33. (
  34. 'type' => 'int-11',
  35. 'name' => '站点',
  36. 'default' => '',
  37. 'desc' => '请输入站点',
  38. 'match' => 'is_numeric',
  39. //'search' => 'order,fulltext',
  40. //'update' => 'text',
  41. //'list' => true,
  42. ),
  43. 'mid' => array
  44. (
  45. 'type' => 'varchar-150',
  46. 'name' => '素材id',
  47. 'default' => '',
  48. 'desc' => '素材id',
  49. 'search' => 'fulltext',
  50. //'list' => true,
  51. 'match' => 'option',
  52. ),
  53. 'name' => array
  54. (
  55. 'type' => 'varchar-50',
  56. 'name' => '标题',
  57. 'default' => '',
  58. 'desc' => '请输入标题',
  59. 'match' => 'is_string',
  60. 'search' => 'fulltext',
  61. 'list' => true,
  62. ),
  63. 'file' => array
  64. (
  65. 'type' => 'varchar-150',
  66. 'name' => '原文件地址',
  67. 'default' => '',
  68. 'desc' => '请输入原文件地址',
  69. 'match' => 'is_string',
  70. 'list' => 'table',
  71. 'modal' => '查看详情',
  72. ),
  73. 'down_url' => array
  74. (
  75. 'type' => 'varchar-150',
  76. 'name' => '下载地址',
  77. 'default' => '',
  78. 'desc' => '请输入下载地址',
  79. 'match' => 'is_string',
  80. //'list' => true,
  81. ),
  82. 'type' => array
  83. (
  84. 'type' => 'varchar-10',
  85. 'name' => '类型',
  86. 'default' => 'image',
  87. 'desc' => '请选择类型',
  88. 'match' => 'is_string',
  89. 'option' => $type,
  90. //'update' => 'radio',
  91. 'list' => true,
  92. ),
  93. 'content_id' => array
  94. (
  95. 'type' => 'int-11',
  96. 'name' => '是否被消息使用',
  97. 'default' => '-1',
  98. 'desc' => '是否被消息使用',
  99. 'list' => '{content_id} < 0 ? "未被使用" : "已被使用"',
  100. 'match' => 'option',
  101. ),
  102. 'cdate' => array
  103. (
  104. 'type' => 'int-11',
  105. 'name' => '录入时间',
  106. 'match' => array('is_numeric', time()),
  107. 'desc' => '',
  108. # 只有insert时才生效
  109. 'insert' => true,
  110. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  111. ),
  112. ),
  113. 'manage' => array
  114. (
  115. # 同时更新另外一个表
  116. //'updateTable' => 'weixin/message',
  117. ),
  118. 'auth' => 'site',
  119. # request 请求接口定义
  120. 'request' => array
  121. (
  122. 'file' => array
  123. (
  124. 'where' => array
  125. (
  126. 'file' => 'yes',
  127. //'site' => 'yes',
  128. ),
  129. 'type' => 'one',
  130. ),
  131. 'use' => array
  132. (
  133. 'where' => array
  134. (
  135. 'type' => 'yes',
  136. 'content_id' => 'yes',
  137. //'site' => 'yes',
  138. ),
  139. 'type' => 'one',
  140. ),
  141. 'all' => array
  142. (
  143. 'where' => array
  144. (
  145. 'state' => 1,
  146. //'site' => 'yes',
  147. ),
  148. 'type' => 'all',
  149. 'order' => array('id', 'desc'),
  150. 'col' => '*|id',
  151. ),
  152. ),
  153. );