live_comment.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. 'content' => array
  65. (
  66. 'type' => 'text-255',
  67. 'name' => '内容',
  68. 'update' => 'editor',
  69. 'key' => 1,
  70. 'default' => '',
  71. 'desc' => '请输入内容',
  72. 'match' => 'is_string',
  73. 'search' => 'fulltext',
  74. //'list' => 'table',
  75. //'modal' => '查看详情',
  76. 'list' => true,
  77. ),
  78. 'state' => array
  79. (
  80. 'type' => 'tinyint-1',
  81. 'name' => '状态',
  82. 'default' => '1',
  83. 'desc' => '请选择状态',
  84. 'match' => 'is_numeric',
  85. ),
  86. 'cdate' => array
  87. (
  88. 'type' => 'int-11',
  89. 'name' => '评论时间',
  90. 'match' => array('is_numeric', time()),
  91. 'desc' => '',
  92. # 只有insert时才生效
  93. 'insert' => true,
  94. 'search' => 'date',
  95. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  96. ),
  97. ),
  98. 'manage' => array
  99. (
  100. 'insert' => false,
  101. 'edit' => false,
  102. ),
  103. # request 请求接口定义
  104. 'request' => array
  105. (
  106. 'getAll' => array
  107. (
  108. # 匹配的正则或函数 选填项
  109. 'option' => array
  110. (
  111. 'data_id' => 'yes',
  112. 'type' => 'yes',
  113. 'state' => 1,
  114. ),
  115. 'type' => 'all',
  116. 'order' => array('id' => 'desc'),
  117. 'page' => array(50, 'list'),
  118. 'col' => '*',
  119. ),
  120. )
  121. );