func.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <?php
  2. $col = function()
  3. {
  4. $array = array
  5. (
  6. -1 => array('id' => '-1', 'name' => '请选择字段',),
  7. );
  8. $info = Dever::db('push/col')->state();
  9. if($info)
  10. {
  11. $array += $info;
  12. }
  13. return $array;
  14. };
  15. return array
  16. (
  17. # 表名
  18. 'name' => 'func',
  19. # 显示给用户看的名称
  20. 'lang' => '功能设置',
  21. # 后台菜单排序
  22. 'order' => 2,
  23. 'menu' => false,
  24. # 数据结构
  25. 'struct' => array
  26. (
  27. 'id' => array
  28. (
  29. 'type' => 'int-11',
  30. 'name' => 'ID',
  31. 'default' => '',
  32. 'desc' => '',
  33. 'match' => 'is_numeric',
  34. 'search' => 'order',
  35. 'list' => true,
  36. 'order' => 'desc',
  37. ),
  38. 'name' => array
  39. (
  40. 'type' => 'varchar-32',
  41. 'name' => '功能名称',
  42. 'default' => '',
  43. 'desc' => '功能名称',
  44. 'match' => 'is_string',
  45. 'update' => 'text',
  46. 'search' => 'fulltext',
  47. 'list' => true,
  48. ),
  49. 'api' => array
  50. (
  51. 'type' => 'varchar-200',
  52. 'name' => '功能接口-可以直接输入http接口地址,也可以使用dever接口,如果接口返回一条数据,就为单条,如果是多条,就是列表',
  53. 'default' => '',
  54. 'desc' => '功能接口',
  55. 'match' => 'is_string',
  56. 'update' => 'textarea',
  57. 'search' => 'fulltext',
  58. 'list' => true,
  59. ),
  60. 'col' => array
  61. (
  62. 'type' => 'text-1000',
  63. 'name' => '关联字段',
  64. 'default' => '',
  65. 'desc' => '关联字段',
  66. 'match' => 'is_string',
  67. 'update' => array
  68. (
  69. array
  70. (
  71. 'col' => 'name',
  72. 'name' => '接口原始字段名-输入上述功能接口返回的原始字段的名字',
  73. 'default' => '',
  74. 'desc' => '接口原始字段名',
  75. 'match' => 'is_string',
  76. 'update' => 'text',
  77. ),
  78. array
  79. (
  80. 'col' => 'col_id',
  81. 'name' => '关联的字段',
  82. 'default' => '',
  83. 'desc' => '关联的字段',
  84. 'match' => 'is_numeric',
  85. 'update' => 'select',
  86. 'option' => $col,
  87. ),
  88. ),
  89. ),
  90. 'reorder' => array
  91. (
  92. 'type' => 'int-11',
  93. 'name' => '排序(数值越大越靠前)',
  94. 'default' => '1',
  95. 'desc' => '请输入排序',
  96. 'match' => 'option',
  97. 'update' => 'text',
  98. 'search' => 'order',
  99. 'list' => true,
  100. 'order' => 'desc',
  101. 'edit' => true,
  102. ),
  103. 'state' => array
  104. (
  105. 'type' => 'tinyint-1',
  106. 'name' => '状态',
  107. 'default' => '1',
  108. 'desc' => '请选择状态',
  109. 'match' => 'is_numeric',
  110. ),
  111. 'cdate' => array
  112. (
  113. 'type' => 'int-11',
  114. 'name' => '录入时间',
  115. 'match' => array('is_numeric', time()),
  116. 'desc' => '',
  117. # 只有insert时才生效
  118. 'insert' => true,
  119. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  120. ),
  121. ),
  122. 'manage' => array
  123. (
  124. ),
  125. 'request' => array
  126. (
  127. 'state' => array
  128. (
  129. # 匹配的正则或函数 选填项
  130. 'option' => array
  131. (
  132. 'state' => 1,
  133. ),
  134. 'type' => 'all',
  135. 'order' => array('reorder' => 'desc','id' => 'desc'),
  136. 'col' => '*|id',
  137. ),
  138. 'getAll' => array
  139. (
  140. # 匹配的正则或函数 选填项
  141. 'option' => array
  142. (
  143. 'state' => 1,
  144. # 小程序去掉视频栏目
  145. 'id_no' => array('yes-id', '!='),
  146. ),
  147. 'type' => 'all',
  148. 'order' => array('reorder' => 'desc','id' => 'desc'),
  149. 'col' => '*',
  150. ),
  151. ),
  152. );