vote.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <?php
  2. $table = array
  3. (
  4. 1 => '资讯',
  5. 2 => '课程',
  6. );
  7. return array
  8. (
  9. # 表名
  10. 'name' => 'vote',
  11. # 显示给用户看的名称
  12. 'lang' => '用户点赞管理',
  13. 'order' => 100,
  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. //'search' => 'order',
  25. //'list' => true,
  26. ),
  27. 'uid' => array
  28. (
  29. 'type' => 'int-11',
  30. 'name' => '用户',
  31. 'default' => '',
  32. 'desc' => '用户ID',
  33. 'match' => 'is_numeric',
  34. 'search' => 'order',
  35. 'list' => '{uid} > 0 ? Dever::load("passport/user-one#name", {uid}) : "匿名用户"',
  36. ),
  37. 'info_id' => array
  38. (
  39. 'type' => 'int-11',
  40. 'name' => '所属小程序',
  41. 'default' => '1',
  42. 'desc' => '请选择所属小程序',
  43. 'match' => 'is_numeric',
  44. 'update' => 'select',
  45. 'option' => $info,
  46. 'search' => 'select',
  47. 'list' => '{info_id} > 0 ? Dever::load("set/info-one#name", {info_id}) : "未知"',
  48. ),
  49. 'source_table' => array
  50. (
  51. 'type' => 'tinyint-1',
  52. 'name' => '点赞类别',
  53. 'default' => '',
  54. 'desc' => '点赞类别',
  55. 'match' => 'option',
  56. 'option' => $table,
  57. 'list' => true,
  58. ),
  59. 'source_id' => array
  60. (
  61. 'type' => 'int-11',
  62. 'name' => '标题',
  63. 'default' => '',
  64. 'desc' => '标题',
  65. 'match' => 'option',
  66. 'list' => '{source_table} == 1 ? Dever::load("content/news-one#name", {source_id}) : Dever::load("content/course-one#name", {source_id})',
  67. ),
  68. 'ip' => array
  69. (
  70. 'type' => 'varchar-32',
  71. 'name' => 'IP',
  72. 'default' => '',
  73. 'desc' => '请输入IP',
  74. 'match' => 'option',
  75. 'update' => 'text',
  76. 'search' => 'fulltext',
  77. 'list' => true,
  78. ),
  79. 'state' => array
  80. (
  81. 'type' => 'tinyint-1',
  82. 'name' => '状态',
  83. 'default' => '1',
  84. 'desc' => '请选择状态',
  85. 'match' => 'is_numeric',
  86. ),
  87. 'cdate' => array
  88. (
  89. 'type' => 'int-11',
  90. 'name' => '点赞时间',
  91. 'match' => array('is_numeric', time()),
  92. 'desc' => '',
  93. # 只有insert时才生效
  94. 'insert' => true,
  95. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  96. ),
  97. ),
  98. 'manage' => array
  99. (
  100. 'insert' => false,
  101. ),
  102. );