up.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <?php
  2. $table = Dever::config('base')->table;
  3. $table_name = Dever::config('base')->table_name;
  4. return array
  5. (
  6. # 表名
  7. 'name' => 'up',
  8. # 显示给用户看的名称
  9. 'lang' => '点赞日志',
  10. # 是否显示在后台菜单
  11. 'order' => 79,
  12. 'menu' => false,
  13. # 数据结构
  14. 'struct' => array
  15. (
  16. 'id' => array
  17. (
  18. 'type' => 'int-11',
  19. 'name' => 'ID',
  20. 'default' => '',
  21. 'desc' => '',
  22. 'match' => 'is_numeric',
  23. 'order' => 'desc',
  24. //'list' => true,
  25. ),
  26. 'uid' => array
  27. (
  28. 'type' => 'int-11',
  29. 'name' => '用户名',
  30. 'default' => '0',
  31. 'desc' => '请选择用户',
  32. 'match' => 'is_numeric',
  33. 'update' => 'text',
  34. //'search' => 'select',
  35. 'search' => array
  36. (
  37. 'api' => 'passport/user-all',
  38. 'col' => 'username',
  39. 'result' => 'id',
  40. ),
  41. 'list' => '{uid} > 0 ? Dever::load("passport/user-one#username", {uid}) : "匿名用户"',
  42. ),
  43. 'type' => array
  44. (
  45. 'type' => 'tinyint-1',
  46. 'name' => '所属数据源',
  47. 'default' => '',
  48. 'desc' => '所属数据源',
  49. 'match' => 'option',
  50. 'option' => $table,
  51. 'search' => 'select',
  52. 'update' => 'select',
  53. 'list' => true,
  54. ),
  55. 'type_id' => array
  56. (
  57. 'type' => 'int-11',
  58. 'name' => '数据源id',
  59. 'default' => '',
  60. 'desc' => '数据源id',
  61. 'match' => 'option',
  62. 'update' => 'text',
  63. ),
  64. 'state' => array
  65. (
  66. 'type' => 'tinyint-1',
  67. 'name' => '状态',
  68. 'default' => '1',
  69. 'desc' => '请选择状态',
  70. 'match' => 'is_numeric',
  71. ),
  72. 'cdate' => array
  73. (
  74. 'type' => 'int-11',
  75. 'name' => '喜欢时间',
  76. 'match' => array('is_numeric', time()),
  77. 'desc' => '',
  78. # 只有insert时才生效
  79. 'insert' => true,
  80. 'search' => 'date',
  81. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  82. ),
  83. ),
  84. 'manage' => array
  85. (
  86. 'insert' => false,
  87. 'edit' => false,
  88. 'delete' => false,
  89. ),
  90. # request 请求接口定义
  91. 'request' => array
  92. (
  93. 'getAll' => array
  94. (
  95. # 匹配的正则或函数 选填项
  96. 'option' => array
  97. (
  98. 'uid' => 'yes',
  99. 'type_id' => 'yes',
  100. 'type' => array('yes', 'in'),
  101. 'state' => 1,
  102. ),
  103. 'type' => 'all',
  104. 'order' => array('cdate' => 'desc'),
  105. 'page' => array(15, 'list'),
  106. 'col' => 'uid,type,type_id,cdate',
  107. ),
  108. 'getHot' => array
  109. (
  110. # 匹配的正则或函数 选填项
  111. 'option' => array
  112. (
  113. 'uid' => 'yes',
  114. 'type' => 'yes',
  115. 'type_id' => 'yes',
  116. 'state' => 1,
  117. ),
  118. 'type' => 'all',
  119. 'order' => array('cdate' => 'desc'),
  120. 'limit' => '0,10',
  121. 'col' => '*',
  122. ),
  123. 'getTotal' => array
  124. (
  125. # 匹配的正则或函数 选填项
  126. 'option' => array
  127. (
  128. 'uid' => 'yes',
  129. 'type' => 'yes',
  130. 'type_id' => 'yes',
  131. 'state' => 1,
  132. ),
  133. 'type' => 'count',
  134. ),
  135. )
  136. );