func.php 4.3 KB

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