comment.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <?php
  2. return array
  3. (
  4. # 表名
  5. 'name' => 'comment',
  6. # 显示给用户看的名称
  7. 'lang' => '评论管理',
  8. # 是否显示在后台菜单
  9. 'menu' => false,
  10. 'order' => 80,
  11. # 数据结构
  12. 'struct' => array
  13. (
  14. 'id' => array
  15. (
  16. 'type' => 'int-11',
  17. 'name' => 'ID',
  18. 'default' => '',
  19. 'desc' => '',
  20. 'match' => 'is_numeric',
  21. 'order' => 'desc',
  22. //'list' => true,
  23. ),
  24. 'uid' => array
  25. (
  26. 'type' => 'int-11',
  27. 'name' => '用户名',
  28. 'default' => '0',
  29. 'desc' => '请选择用户',
  30. 'match' => 'is_numeric',
  31. 'update' => 'text',
  32. //'search' => 'select',
  33. 'search' => array
  34. (
  35. 'api' => 'passport/user-all',
  36. 'col' => 'username',
  37. 'result' => 'id',
  38. ),
  39. 'list' => '{uid} > 0 ? Dever::load("passport/user-one#username", {uid}) : "匿名用户"',
  40. ),
  41. 'type' => array
  42. (
  43. 'type' => 'varchar-50',
  44. 'name' => '数据源表名',
  45. 'default' => '',
  46. 'desc' => '数据源表名',
  47. 'match' => 'option',
  48. 'search' => 'select',
  49. 'update' => 'text',
  50. 'list' => true,
  51. ),
  52. 'type_id' => array
  53. (
  54. 'type' => 'int-11',
  55. 'name' => '数据源id',
  56. 'default' => '',
  57. 'desc' => '数据源id',
  58. 'match' => 'option',
  59. 'update' => 'text',
  60. ),
  61. 'pic' => array
  62. (
  63. 'type' => 'varchar-2000',
  64. 'name' => '图片-图片尺寸不等,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  65. 'default' => '',
  66. 'desc' => '图片',
  67. 'match' => 'is_string',
  68. 'update' => 'images',
  69. 'key' => '1',
  70. ),
  71. 'content' => array
  72. (
  73. 'type' => 'varchar-800',
  74. 'name' => '内容',
  75. 'update' => 'editor',
  76. 'key' => 1,
  77. 'default' => '',
  78. 'desc' => '请输入内容',
  79. 'match' => 'is_string',
  80. 'search' => 'fulltext',
  81. //'list' => 'table',
  82. //'modal' => '查看详情',
  83. //'list' => 'Dever::load("community/lib/info.content", "{content}", {id})',
  84. ),
  85. 'playtime' => array
  86. (
  87. 'type' => 'int-11',
  88. 'name' => '播放时间',
  89. 'default' => '',
  90. 'desc' => '播放时间',
  91. 'match' => 'is_numeric',
  92. 'update' => 'text',
  93. 'search' => 'fulltext',
  94. 'list' => true,
  95. ),
  96. 'state' => array
  97. (
  98. 'type' => 'tinyint-1',
  99. 'name' => '状态',
  100. 'default' => '1',
  101. 'desc' => '请选择状态',
  102. 'match' => 'is_numeric',
  103. ),
  104. 'cdate' => array
  105. (
  106. 'type' => 'int-11',
  107. 'name' => '时间',
  108. 'match' => array('is_numeric', time()),
  109. 'desc' => '',
  110. # 只有insert时才生效
  111. 'insert' => true,
  112. 'search' => 'date',
  113. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  114. ),
  115. ),
  116. 'manage' => array
  117. (
  118. //'insert' => false,
  119. //'edit' => false,
  120. ),
  121. # request 请求接口定义
  122. 'request' => array
  123. (
  124. 'getAll' => array
  125. (
  126. # 匹配的正则或函数 选填项
  127. 'option' => array
  128. (
  129. 'uid' => 'yes',
  130. 'type' => 'yes',
  131. 'type_id' => 'yes',
  132. 'noid' => array('yes-id', '!='),
  133. 'playtime_start' => array('yes-playtime', '>='),
  134. 'playtime_end' => array('yes-playtime', '<'),
  135. 'state' => 1,
  136. ),
  137. 'type' => 'all',
  138. 'order' => array('playtime' => 'asc', 'id' => 'asc'),
  139. 'page' => array(1000, 'list'),
  140. 'col' => '*',
  141. ),
  142. 'getData' => array
  143. (
  144. # 匹配的正则或函数 选填项
  145. 'option' => array
  146. (
  147. 'uid' => 'yes',
  148. 'type' => 'yes',
  149. 'type_id' => 'yes',
  150. 'noid' => array('yes-id', '!='),
  151. 'state' => 1,
  152. ),
  153. 'type' => 'all',
  154. 'order' => array('id' => 'desc'),
  155. 'page' => array(10, 'list'),
  156. 'col' => '*',
  157. ),
  158. )
  159. );