feedback.php 3.6 KB

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