pic.php 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. <?php
  2. $status = Dever::config('base')->status;
  3. $is_button = array
  4. (
  5. 1 => '显示',
  6. 2 => '不显示',
  7. );
  8. $text = array
  9. (
  10. 1 => '上左',
  11. 2 => '上中',
  12. 3 => '上右',
  13. 4 => '中左',
  14. 5 => '正中',
  15. 6 => '中右',
  16. 7 => '下左',
  17. 8 => '下中',
  18. 9 => '下右',
  19. //10 => '自定义',
  20. );
  21. $type = array
  22. (
  23. 1 => '长屏图',
  24. 2 => '横屏图',
  25. );
  26. $bgcolor_type = array
  27. (
  28. 1 => '设置背景颜色',
  29. 2 => '不设置背景颜色',
  30. );
  31. return array
  32. (
  33. # 表名
  34. 'name' => 'pic',
  35. # 显示给用户看的名称
  36. 'lang' => '图片内容',
  37. 'order' => 100,
  38. 'menu' => false,
  39. 'end' => array
  40. (
  41. 'insert' => 'collection/lib/content.updateTypeId',
  42. 'update' => 'collection/lib/content.updateTypeId',
  43. ),
  44. # 数据结构
  45. 'struct' => array
  46. (
  47. 'id' => array
  48. (
  49. 'type' => 'int-11',
  50. 'name' => 'ID',
  51. 'default' => '',
  52. 'desc' => '',
  53. 'match' => 'is_numeric',
  54. //'list' => true,
  55. ),
  56. 'info_id' => array
  57. (
  58. 'type' => 'int-11',
  59. 'name' => '合集',
  60. 'default' => '',
  61. 'desc' => '合集',
  62. 'match' => 'is_numeric',
  63. 'update' => 'hidden',
  64. 'value' => Dever::input('search_option_info_id')
  65. ),
  66. 'content_id' => array
  67. (
  68. 'type' => 'int-11',
  69. 'name' => '合集内容id',
  70. 'default' => '',
  71. 'desc' => '合集内容id',
  72. 'match' => 'is_numeric',
  73. 'update' => 'hidden',
  74. 'value' => Dever::input('search_option_content_id')
  75. ),
  76. 'type' => array
  77. (
  78. 'type' => 'tinyint-1',
  79. 'name' => '展示类型',
  80. 'default' => '1',
  81. 'desc' => '展示类型',
  82. 'match' => 'is_numeric',
  83. 'update' => 'radio',
  84. 'option' => $type,
  85. ),
  86. 'pic' => array
  87. (
  88. 'type' => 'varchar-150',
  89. 'name' => '图片-长屏图图片尺寸750*高度不限或等比尺寸,横屏图图片尺寸宽度不限*1386px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  90. 'default' => '',
  91. 'desc' => '图片',
  92. 'match' => 'option',
  93. 'update' => 'image',
  94. 'key' => '1',
  95. 'place' => '750*1386',
  96. 'list' => 'Dever::load("content/lib/manage.pic", "{pic}")',
  97. ),
  98. 'pic_info' => array
  99. (
  100. 'type' => 'varchar-500',
  101. 'name' => '图片信息',
  102. 'default' => '',
  103. 'desc' => '图片信息',
  104. 'match' => 'is_string',
  105. 'update' => 'hidden',
  106. ),
  107. 'text' => array
  108. (
  109. 'type' => 'text-1000',
  110. 'name' => '文字设置',
  111. 'default' => '',
  112. 'desc' => '文字设置',
  113. 'match' => 'is_string',
  114. 'option' => $text,
  115. 'update' => array
  116. (
  117. array
  118. (
  119. 'col' => 'name',
  120. 'name' => '文字内容',
  121. 'default' => '',
  122. 'desc' => '文字内容',
  123. 'match' => 'is_string',
  124. 'update' => 'textarea',
  125. ),
  126. array
  127. (
  128. 'col' => 'color',
  129. 'name' => '文字颜色',
  130. 'default' => '#000000',
  131. 'desc' => '文字颜色',
  132. 'match' => 'is_string',
  133. 'update' => 'color',
  134. ),
  135. array
  136. (
  137. 'col' => 'bgcolor_type',
  138. 'name' => '是否设置背景颜色',
  139. 'default' => '2',
  140. 'desc' => '是否设置背景颜色',
  141. 'match' => 'is_string',
  142. 'update' => 'radio',
  143. 'option' => $bgcolor_type,
  144. 'control' => 'bgcolor_type',
  145. ),
  146. array
  147. (
  148. 'col' => 'bgcolor',
  149. 'name' => '背景颜色',
  150. 'default' => '#000000',
  151. 'desc' => '背景颜色',
  152. 'match' => 'is_string',
  153. 'update' => 'color',
  154. 'show' => 'bgcolor_type=1'
  155. ),
  156. array
  157. (
  158. 'col' => 'size',
  159. 'name' => '文字大小-直接输入像素数字',
  160. 'default' => '16',
  161. 'desc' => '结果描述',
  162. 'match' => 'is_numeric',
  163. 'update' => 'text',
  164. ),
  165. array
  166. (
  167. 'col' => 'goods_id',
  168. 'name' => '选择商品',
  169. 'default' => '',
  170. 'desc' => '选择商品',
  171. 'match' => 'option',
  172. 'update' => 'select',
  173. 'update_search' => 'goods/lib/manage.search',
  174. ),
  175. ),
  176. ),
  177. 'is_button' => array
  178. (
  179. 'type' => 'int-11',
  180. 'name' => '是否显示保存按钮',
  181. 'default' => '2',
  182. 'desc' => '是否显示保存按钮',
  183. 'match' => 'is_numeric',
  184. 'update' => 'radio',
  185. 'option' => $is_button,
  186. 'control' => 'is_button',
  187. ),
  188. 'button_name' => array
  189. (
  190. 'type' => 'varchar-80',
  191. 'name' => '保存按钮文字内容',
  192. 'default' => '保存图片',
  193. 'desc' => '保存按钮文字内容',
  194. 'match' => 'option',
  195. 'update' => 'textarea',
  196. 'show' => 'is_button=1',
  197. ),
  198. 'button_color' => array
  199. (
  200. 'type' => 'varchar-10',
  201. 'name' => '保存按钮文字颜色',
  202. 'default' => '#000000',
  203. 'desc' => '保存按钮文字颜色',
  204. 'match' => 'option',
  205. 'update' => 'color',
  206. 'show' => 'is_button=1',
  207. ),
  208. 'udate' => array
  209. (
  210. 'type' => 'int-11',
  211. 'name' => '更新时间',
  212. 'match' => array('is_numeric', time()),
  213. 'desc' => '',
  214. ),
  215. 'status' => array
  216. (
  217. 'type' => 'int-11',
  218. 'name' => '发布状态',
  219. 'default' => '1',
  220. 'desc' => '发布状态',
  221. 'match' => 'is_numeric',
  222. //'update' => 'select',
  223. 'option' => $status,
  224. //'search' => 'select',
  225. //'list' => true,
  226. //'edit' => true,
  227. ),
  228. 'reorder' => array
  229. (
  230. 'type' => 'int-11',
  231. 'name' => '排序(数值越大越靠前)',
  232. 'default' => '1',
  233. 'desc' => '请输入排序',
  234. 'match' => 'option',
  235. //'update' => 'text',
  236. 'search' => 'order',
  237. 'list' => true,
  238. 'order' => 'desc',
  239. 'edit' => true,
  240. ),
  241. 'state' => array
  242. (
  243. 'type' => 'tinyint-1',
  244. 'name' => '状态',
  245. 'default' => '1',
  246. 'desc' => '请选择状态',
  247. 'match' => 'is_numeric',
  248. ),
  249. 'cdate' => array
  250. (
  251. 'type' => 'int-11',
  252. 'name' => '录入时间',
  253. 'match' => array('is_numeric', time()),
  254. 'desc' => '',
  255. # 只有insert时才生效
  256. 'insert' => true,
  257. ),
  258. ),
  259. # 管理功能
  260. 'manage' => array
  261. (
  262. ),
  263. # request 请求接口定义
  264. 'request' => array
  265. (
  266. 'getAll' => array
  267. (
  268. # 匹配的正则或函数 选填项
  269. 'option' => array
  270. (
  271. 'info_id' => 'yes',
  272. 'content_id' => 'yes',
  273. 'state' => 1,
  274. ),
  275. 'type' => 'all',
  276. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  277. 'col' => '*',
  278. ),
  279. ),
  280. );