like.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <?php
  2. $table = Dever::config('base')->type;
  3. return array
  4. (
  5. # 表名
  6. 'name' => 'like',
  7. # 显示给用户看的名称
  8. 'lang' => '喜欢日志',
  9. # 是否显示在后台菜单
  10. 'order' => 79,
  11. # 数据结构
  12. 'struct' => array
  13. (
  14. 'id' => array
  15. (
  16. 'type' => 'int-11',
  17. 'name' => 'ID',
  18. 'default' => '',
  19. 'desc' => '',
  20. 'match' => 'is_numeric',
  21. 'order' => 'desc',
  22. //'list' => true,
  23. ),
  24. 'uid' => array
  25. (
  26. 'type' => 'int-11',
  27. 'name' => '用户',
  28. 'default' => '0',
  29. 'desc' => '请选择用户',
  30. 'match' => 'is_numeric',
  31. //'update' => 'select',
  32. //'search' => 'select',
  33. 'list' => '{uid} > 0 ? Dever::load("passport/user-one#username", {uid}) : "匿名用户"',
  34. ),
  35. 'source_table' => array
  36. (
  37. 'type' => 'tinyint-1',
  38. 'name' => '类别',
  39. 'default' => '',
  40. 'desc' => '类别',
  41. 'match' => 'option',
  42. 'option' => $table,
  43. 'list' => true,
  44. ),
  45. 'source_id' => array
  46. (
  47. 'type' => 'int-11',
  48. 'name' => '标题',
  49. 'default' => '',
  50. 'desc' => '标题',
  51. 'match' => 'option',
  52. 'list' => 'Dever::load("act/lib/manage.load", "{source_table}", {source_id})',
  53. ),
  54. 'content' => array
  55. (
  56. 'type' => 'text-255',
  57. 'name' => '内容',
  58. 'update' => 'editor',
  59. 'key' => 1,
  60. 'default' => '',
  61. 'desc' => '请输入内容',
  62. 'match' => 'is_string',
  63. 'search' => 'fulltext',
  64. 'list' => 'table',
  65. 'modal' => '查看详情',
  66. ),
  67. 'state' => array
  68. (
  69. 'type' => 'tinyint-1',
  70. 'name' => '状态',
  71. 'default' => '1',
  72. 'desc' => '请选择状态',
  73. 'match' => 'is_numeric',
  74. ),
  75. 'cdate' => array
  76. (
  77. 'type' => 'int-11',
  78. 'name' => '喜欢时间',
  79. 'match' => array('is_numeric', time()),
  80. 'desc' => '',
  81. # 只有insert时才生效
  82. 'insert' => true,
  83. 'search' => 'date',
  84. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  85. ),
  86. ),
  87. 'manage' => array
  88. (
  89. 'insert' => false,
  90. 'edit' => false,
  91. 'delete' => false,
  92. ),
  93. );