comment.php 3.0 KB

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