share_reflux.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <?php
  2. $table = array
  3. (
  4. 1 => '资讯',
  5. 2 => '课程',
  6. 3 => '会议',
  7. );
  8. $info = function()
  9. {
  10. $array = array();
  11. $info = Dever::load('set/info-state');
  12. if($info)
  13. {
  14. $array += $info;
  15. }
  16. return $array;
  17. };
  18. return array
  19. (
  20. # 表名
  21. 'name' => 'share_reflux',
  22. # 显示给用户看的名称
  23. 'lang' => '分享回流',
  24. # 是否显示在后台菜单
  25. 'order' => 60,
  26. # 数据结构
  27. 'struct' => array
  28. (
  29. 'id' => array
  30. (
  31. 'type' => 'int-11',
  32. 'name' => 'ID',
  33. 'default' => '',
  34. 'desc' => '',
  35. 'match' => 'is_numeric',
  36. 'order' => 'desc',
  37. //'list' => true,
  38. ),
  39. 'uid' => array
  40. (
  41. 'type' => 'int-11',
  42. 'name' => '用户',
  43. 'default' => '0',
  44. 'desc' => '请选择用户',
  45. 'match' => 'is_numeric',
  46. //'update' => 'select',
  47. //'search' => 'select',
  48. 'list' => '{uid} > 0 ? Dever::load("passport/user-one#name", {uid}) : "匿名用户"',
  49. ),
  50. 'info_id' => array
  51. (
  52. 'type' => 'int-11',
  53. 'name' => '所属小程序',
  54. 'default' => '1',
  55. 'desc' => '请选择所属小程序',
  56. 'match' => 'is_numeric',
  57. 'update' => 'select',
  58. 'option' => $info,
  59. 'search' => 'select',
  60. 'list' => '{info_id} > 0 ? Dever::load("set/info-one#name", {info_id}) : "未知"',
  61. ),
  62. 'source_table' => array
  63. (
  64. 'type' => 'tinyint-1',
  65. 'name' => '分享类别',
  66. 'default' => '',
  67. 'desc' => '分享类别',
  68. 'match' => 'option',
  69. 'option' => $table,
  70. 'list' => true,
  71. ),
  72. 'source_id' => array
  73. (
  74. 'type' => 'int-11',
  75. 'name' => '标题',
  76. 'default' => '',
  77. 'desc' => '标题',
  78. 'match' => 'option',
  79. 'list' => 'Dever::load("set/manage.load", "{source_table}", {source_id})',
  80. ),
  81. 'source_uid' => array
  82. (
  83. 'type' => 'int-11',
  84. 'name' => '分享者',
  85. 'default' => '',
  86. 'desc' => '分享者',
  87. 'match' => 'option',
  88. 'list' => '{source_uid} > 0 ? Dever::load("passport/user-one#name", {source_uid}) : "匿名用户"',
  89. ),
  90. 'share_id' => array
  91. (
  92. 'type' => 'int-11',
  93. 'name' => '分享id',
  94. 'default' => '',
  95. 'desc' => '分享id',
  96. 'match' => 'option',
  97. ),
  98. 'state' => array
  99. (
  100. 'type' => 'tinyint-1',
  101. 'name' => '状态',
  102. 'default' => '1',
  103. 'desc' => '请选择状态',
  104. 'match' => 'is_numeric',
  105. ),
  106. 'cdate' => array
  107. (
  108. 'type' => 'int-11',
  109. 'name' => '录入时间',
  110. 'match' => array('is_numeric', time()),
  111. 'desc' => '',
  112. # 只有insert时才生效
  113. 'insert' => true,
  114. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  115. ),
  116. ),
  117. 'manage' => array
  118. (
  119. 'insert' => false,
  120. 'edit' => false,
  121. 'delete' => false,
  122. ),
  123. # request 请求接口定义
  124. 'request' => array
  125. (
  126. ),
  127. );