share_reflux.php 2.6 KB

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