button.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <?php
  2. # 定义几个常用的选项
  3. $status = Dever::config('base')->status;
  4. $type = array
  5. (
  6. 1 => '进入合集',
  7. 2 => '购买门票',
  8. 3 => '查看排行榜',
  9. 10 => '链接',
  10. );
  11. return array
  12. (
  13. # 表名
  14. 'name' => 'button',
  15. # 显示给用户看的名称
  16. 'lang' => '首页按钮配置',
  17. 'order' => 100,
  18. 'menu' => false,
  19. # 数据结构
  20. 'struct' => array
  21. (
  22. 'id' => array
  23. (
  24. 'type' => 'int-11',
  25. 'name' => 'ID',
  26. 'default' => '',
  27. 'desc' => '',
  28. 'match' => 'is_numeric',
  29. 'search' => 'order',
  30. //'list' => true,
  31. ),
  32. 'info_id' => array
  33. (
  34. 'type' => 'int-11',
  35. 'name' => '合集',
  36. 'default' => '',
  37. 'desc' => '合集',
  38. 'match' => 'is_numeric',
  39. 'update' => 'hidden',
  40. 'value' => Dever::input('search_option_info_id')
  41. ),
  42. 'name' => array
  43. (
  44. 'type' => 'varchar-80',
  45. 'name' => '按钮名称',
  46. 'default' => '',
  47. 'desc' => '按钮名称',
  48. 'match' => 'is_string',
  49. 'update' => 'text',
  50. //'search' => 'fulltext',
  51. 'list' => true,
  52. ),
  53. 'type' => array
  54. (
  55. 'type' => 'int-11',
  56. 'name' => '类型',
  57. 'default' => '1',
  58. 'desc' => '类型',
  59. 'match' => 'is_numeric',
  60. 'update' => 'select',
  61. 'option' => $type,
  62. 'search' => 'select',
  63. 'list' => true,
  64. //'edit' => true,
  65. 'control' => 'type',
  66. ),
  67. 'link' => array
  68. (
  69. 'type' => 'varchar-150',
  70. 'name' => '链接',
  71. 'default' => '',
  72. 'desc' => '链接',
  73. 'match' => 'option',
  74. 'update' => 'text',
  75. 'show' => 'type=10',
  76. ),
  77. 'info' => array
  78. (
  79. 'type' => 'varchar-80',
  80. 'name' => '介绍',
  81. 'default' => '',
  82. 'desc' => '介绍',
  83. 'match' => 'option',
  84. 'update' => 'text',
  85. //'search' => 'fulltext',
  86. ),
  87. 'icon' => array
  88. (
  89. 'type' => 'varchar-150',
  90. 'name' => '图标-图片尺寸150*150px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  91. 'default' => '',
  92. 'desc' => '图标',
  93. 'match' => 'option',
  94. 'update' => 'image',
  95. 'key' => '1',
  96. 'place' => '150*150',
  97. ),
  98. 'reorder' => array
  99. (
  100. 'type' => 'int-11',
  101. 'name' => '排序(数值越小越靠前)',
  102. 'default' => '1',
  103. 'desc' => '请输入排序',
  104. 'match' => 'option',
  105. 'update' => 'text',
  106. 'search' => 'order',
  107. 'list_name' => '排序',
  108. 'list' => true,
  109. 'order' => 'asc',
  110. 'edit' => true,
  111. ),
  112. 'state' => array
  113. (
  114. 'type' => 'tinyint-1',
  115. 'name' => '状态',
  116. 'default' => '1',
  117. 'desc' => '请选择状态',
  118. 'match' => 'is_numeric',
  119. ),
  120. 'cdate' => array
  121. (
  122. 'type' => 'int-11',
  123. 'name' => '添加时间',
  124. 'match' => array('is_numeric', time()),
  125. 'desc' => '',
  126. # 只有insert时才生效
  127. 'insert' => true,
  128. //'search' => 'date',
  129. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  130. ),
  131. ),
  132. 'manage' => array
  133. (
  134. ),
  135. 'request' => array
  136. (
  137. 'getAll' => array
  138. (
  139. # 匹配的正则或函数 选填项
  140. 'option' => array
  141. (
  142. 'info_id' => 'yes',
  143. 'state' => 1,
  144. ),
  145. 'type' => 'all',
  146. 'order' => array('reorder' => 'asc', 'id' => 'desc'),
  147. 'col' => '*',
  148. ),
  149. ),
  150. );