feedback.php 3.5 KB

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