live_comment.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <?php
  2. $table = Dever::config('base')->type;
  3. unset($table[1]);
  4. unset($table[2]);
  5. unset($table[4]);
  6. return array
  7. (
  8. # 表名
  9. 'name' => 'live_comment',
  10. # 显示给用户看的名称
  11. 'lang' => '直播留言管理',
  12. # 是否显示在后台菜单
  13. 'order' => 70,
  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. 'content' => array
  76. (
  77. 'type' => 'text-255',
  78. 'name' => '内容',
  79. 'update' => 'editor',
  80. 'key' => 1,
  81. 'default' => '',
  82. 'desc' => '请输入内容',
  83. 'match' => 'is_string',
  84. 'search' => 'fulltext',
  85. //'list' => 'table',
  86. //'modal' => '查看详情',
  87. 'list' => true,
  88. ),
  89. 'state' => array
  90. (
  91. 'type' => 'tinyint-1',
  92. 'name' => '状态',
  93. 'default' => '1',
  94. 'desc' => '请选择状态',
  95. 'match' => 'is_numeric',
  96. ),
  97. 'cdate' => array
  98. (
  99. 'type' => 'int-11',
  100. 'name' => '评论时间',
  101. 'match' => array('is_numeric', time()),
  102. 'desc' => '',
  103. # 只有insert时才生效
  104. 'insert' => true,
  105. 'search' => 'date',
  106. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  107. ),
  108. ),
  109. 'manage' => array
  110. (
  111. 'insert' => false,
  112. 'edit' => false,
  113. ),
  114. # request 请求接口定义
  115. 'request' => array
  116. (
  117. 'getAll' => array
  118. (
  119. # 匹配的正则或函数 选填项
  120. 'option' => array
  121. (
  122. 'data_id' => 'yes',
  123. 'type' => 'yes',
  124. 'state' => 1,
  125. ),
  126. 'type' => 'all',
  127. 'order' => array('id' => 'desc'),
  128. 'page' => array(50, 'list'),
  129. 'col' => '*',
  130. ),
  131. )
  132. );