comment.php 3.1 KB

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