info.php 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. <?php
  2. # 显示的页面
  3. /*
  4. $curPage = Dever::input('search_option_page_id');
  5. $page = function()
  6. {
  7. $parent = Dever::db('push/page')->getParent();
  8. $child = Dever::db('push/page')->getChild();
  9. foreach ($parent as $k => $v) {
  10. $parent[$k]['child'] = $child[$v['id']];
  11. }
  12. $array = array(-1 => array('id' => -1, 'name' => '无'));
  13. if ($parent) {
  14. $array += $parent;
  15. }
  16. return $array;
  17. };
  18. */
  19. $type = array
  20. (
  21. 1 => '手动输入',
  22. /*
  23. 2 => '调取其他推送位',
  24. 3 => '预定义方法',
  25. 4 => '自定义方法',
  26. 5 => '自定义SQL',
  27. 6 => '自定义接口',
  28. */
  29. );
  30. //$define = Dever::config('base')->module;
  31. $col = array
  32. (
  33. 1 => '标题',
  34. //2 => '链接',
  35. 3 => '图片',
  36. 4 => '描述',
  37. );
  38. return array
  39. (
  40. # 表名
  41. 'name' => 'info',
  42. # 显示给用户看的名称
  43. 'lang' => '推送位管理',
  44. 'order' => 10,
  45. 'check' => 'key',
  46. # 数据结构
  47. 'struct' => array
  48. (
  49. 'id' => array
  50. (
  51. 'type' => 'int-11',
  52. 'name' => '推送位ID',
  53. 'default' => '',
  54. 'desc' => '',
  55. 'match' => 'is_numeric',
  56. //'search' => 'order',
  57. 'order' => 'desc',
  58. //'list' => true,
  59. ),
  60. 'name' => array
  61. (
  62. 'type' => 'varchar-60',
  63. 'name' => '推送位标题',
  64. 'default' => '',
  65. 'desc' => '请输入推送位标题',
  66. 'match' => 'is_string',
  67. 'update' => 'text',
  68. 'search' => 'fulltext',
  69. 'list' => true,
  70. 'edit' => true,
  71. ),
  72. 'key' => array
  73. (
  74. 'type' => 'varchar-60',
  75. 'name' => '推送位标识',
  76. 'default' => '',
  77. 'desc' => '推送位标识',
  78. 'match' => 'is_string',
  79. 'update' => 'text',
  80. 'search' => 'fulltext',
  81. 'list' => true,
  82. ),
  83. 'num' => array
  84. (
  85. 'type' => 'int-11',
  86. 'name' => '数据总条数-为空或小于0则不限制,只对前台有效',
  87. 'default' => '5',
  88. 'desc' => '请输入数据总条数',
  89. 'match' => 'is_numeric',
  90. 'update' => 'text',
  91. 'list' => true,
  92. 'edit' => true,
  93. ),
  94. 'type' => array
  95. (
  96. 'type' => 'tinyint-1',
  97. 'name' => '推送位类型',
  98. 'default' => '1',
  99. 'desc' => '请选择推送位类型',
  100. 'match' => 'is_numeric',
  101. 'option' => $type,
  102. 'update' => 'radio',
  103. 'search' => 'select',
  104. //'list' => true,
  105. 'control' => 'type',
  106. ),
  107. /*
  108. 'data_type' => array
  109. (
  110. 'type' => 'varchar-50',
  111. 'name' => '数据类型定义-多个用换行隔开,必须有一个值,主要用于该推送位有多种不同类型的值',
  112. 'default' => '默认类型',
  113. 'desc' => '请选择推送位类型',
  114. 'match' => 'is_string',
  115. //'update' => 'textarea',
  116. //'show' => array('type_1'),
  117. ),
  118. 'code' => array
  119. (
  120. 'type' => 'varchar-500',
  121. 'name' => '自定义内容',
  122. 'default' => '',
  123. 'desc' => '请输入自定义内容',
  124. 'match' => 'is_string',
  125. 'update' => 'textarea',
  126. 'show' => 'type=4,5,6',
  127. ),
  128. 'sql_method' => array
  129. (
  130. 'type' => 'tinyint-1',
  131. 'name' => '选择sql执行之后的方法',
  132. 'default' => '1',
  133. 'desc' => '选择sql执行之后的方法',
  134. 'match' => 'is_numeric',
  135. 'update' => 'radio',
  136. 'option' => $sqlMethod,
  137. 'show' => 'type=5',
  138. ),
  139. 'define' => array
  140. (
  141. 'type' => 'varchar-100',
  142. 'name' => '选择预定义方法',
  143. 'default' => '',
  144. 'desc' => '请选择预定义方法',
  145. 'match' => 'is_string',
  146. 'update' => 'select',
  147. 'option' => $define,
  148. 'show' => 'type=3'
  149. ),
  150. */
  151. 'col' => array
  152. (
  153. 'type' => 'varchar-30',
  154. 'name' => '启用的字段',
  155. 'default' => '1',
  156. 'desc' => '请选择启用的字段',
  157. 'match' => 'is_string',
  158. 'option' => $col,
  159. 'update' => 'checkbox',
  160. 'show' => 'type=1',
  161. 'control' => 'col',
  162. ),
  163. 'col_pic' => array
  164. (
  165. 'type' => 'varchar-20',
  166. 'name' => '图片尺寸提醒-请直接输入提醒的文字即可,如100X100',
  167. 'default' => '100X100',
  168. 'desc' => '图片尺寸提醒',
  169. 'match' => 'is_string',
  170. 'update' => 'text',
  171. 'show' => 'col=3',
  172. ),
  173. 'col_content' => array
  174. (
  175. 'type' => 'int-11',
  176. 'name' => '内容长度限制-必须是数字',
  177. 'default' => '30',
  178. 'desc' => '内容长度限制',
  179. 'match' => 'is_numeric',
  180. 'update' => 'text',
  181. 'show' => 'col=4',
  182. ),
  183. /*
  184. 'relate_id' => array
  185. (
  186. 'type' => 'int-11',
  187. 'name' => '请输入推送位id',
  188. 'default' => '',
  189. 'desc' => '请输入推送位id',
  190. 'match' => 'is_numeric',
  191. 'update' => 'text',
  192. 'show' => 'type=2',
  193. ),
  194. 'preview' => array
  195. (
  196. 'type' => 'varchar-200',
  197. 'name' => '推送位预览地址',
  198. 'default' => '',
  199. 'desc' => '推送位预览地址',
  200. 'match' => 'option',
  201. 'update' => 'text',
  202. ),
  203. 'preview_height' => array
  204. (
  205. 'type' => 'int-11',
  206. 'name' => '推送位预览的高度',
  207. 'default' => '500',
  208. 'desc' => '推送位预览的高度',
  209. 'match' => 'option',
  210. 'update' => 'text',
  211. ),
  212. */
  213. 'reorder' => array
  214. (
  215. 'type' => 'int-11',
  216. 'name' => '排序(数值越大越靠前)',
  217. 'default' => '1',
  218. 'desc' => '请输入排序',
  219. 'match' => 'option',
  220. 'update' => 'text',
  221. 'search' => 'order',
  222. 'list_name' => '排序',
  223. 'list' => true,
  224. 'order' => 'desc',
  225. //'edit' => true,
  226. ),
  227. 'state' => array
  228. (
  229. 'type' => 'tinyint-1',
  230. 'name' => '状态',
  231. 'default' => '1',
  232. 'desc' => '请选择状态',
  233. 'match' => 'is_numeric',
  234. ),
  235. 'cdate' => array
  236. (
  237. 'type' => 'int-11',
  238. 'name' => '录入时间',
  239. 'match' => array('is_numeric', time()),
  240. 'desc' => '',
  241. # 只有insert时才生效
  242. 'insert' => true,
  243. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  244. ),
  245. ),
  246. # 权限精细控制 加入到该项目的详细权限中,注意与top的不同
  247. /*
  248. 'auth' => array
  249. (
  250. # 数据来源
  251. 'data' => 'all',
  252. # 所属项目
  253. 'project' => 'module',
  254. # 项目名称
  255. 'project_name' => '推送位管理',
  256. ),
  257. */
  258. 'manage' => array
  259. (
  260. //'insert' => $curPage ? true : false,
  261. 'list_button' => array
  262. (
  263. 'add' => array('新增数据', '"data&search_option_info_id={id}&oper_parent=info"', '{type} == 1'),
  264. 'list' => array('数据列表', '"data&search_option_info_id={id}&oper_parent=info"'),
  265. ),
  266. ),
  267. # request 请求接口定义
  268. 'request' => array
  269. (
  270. # 获取列表页
  271. 'getAll' => array
  272. (
  273. # 匹配的正则或函数 选填项
  274. 'option' => array
  275. (
  276. 'type' => 'yes',
  277. //'page_id' => 'yes',
  278. 'state' => 1,
  279. ),
  280. 'type' => 'all',
  281. 'order' => array('reorder' => 'desc'),
  282. 'col' => '*',
  283. ),
  284. ),
  285. );