share.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <?php
  2. $table = Dever::config('base')->type;
  3. return array
  4. (
  5. # 表名
  6. 'name' => 'share',
  7. # 显示给用户看的名称
  8. 'lang' => '分享日志',
  9. # 是否显示在后台菜单
  10. 'order' => 78,
  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. 'search' => array
  34. (
  35. 'api' => 'passport/user-all',
  36. 'col' => 'username',
  37. 'result' => 'id',
  38. ),
  39. 'list' => '{uid} > 0 ? Dever::load("passport/user-one#username", {uid}) : "匿名用户"',
  40. ),
  41. 'type' => array
  42. (
  43. 'type' => 'tinyint-1',
  44. 'name' => '分享类别',
  45. 'default' => '',
  46. 'desc' => '分享类别',
  47. 'match' => 'option',
  48. 'option' => $table,
  49. 'list' => true,
  50. 'search' => 'select',
  51. ),
  52. 'data_id' => array
  53. (
  54. 'type' => 'int-11',
  55. 'name' => '标题',
  56. 'default' => '',
  57. 'desc' => '标题',
  58. 'match' => 'option',
  59. 'list' => 'Dever::load("act/lib/manage.load", "{type}", {data_id})',
  60. ),
  61. 'content' => array
  62. (
  63. 'type' => 'text-255',
  64. 'name' => '内容',
  65. 'update' => 'editor',
  66. 'key' => 1,
  67. 'default' => '',
  68. 'desc' => '请输入内容',
  69. 'match' => 'is_string',
  70. //'search' => 'fulltext',
  71. //'list' => 'table',
  72. //'modal' => '查看详情',
  73. ),
  74. 'num' => array
  75. (
  76. 'type' => 'int-11',
  77. 'name' => '分享次数',
  78. 'default' => '',
  79. 'desc' => '分享次数',
  80. 'match' => 'option',
  81. 'list' => true,
  82. ),
  83. 'state' => array
  84. (
  85. 'type' => 'tinyint-1',
  86. 'name' => '状态',
  87. 'default' => '1',
  88. 'desc' => '请选择状态',
  89. 'match' => 'is_numeric',
  90. ),
  91. 'cdate' => array
  92. (
  93. 'type' => 'int-11',
  94. 'name' => '分享时间',
  95. 'match' => array('is_numeric', time()),
  96. 'desc' => '',
  97. # 只有insert时才生效
  98. 'insert' => true,
  99. 'search' => 'date',
  100. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  101. ),
  102. ),
  103. 'manage' => array
  104. (
  105. 'insert' => false,
  106. 'edit' => false,
  107. 'delete' => false,
  108. 'list_button' => array
  109. (
  110. 'list' => array('回流', '"share_reflux&search_option_share_id={id}&oper_parent=share"'),
  111. ),
  112. ),
  113. );