file.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <?php
  2. /**
  3. * 上传表
  4. * demo: data/upload/upload_name/10000/10/10.thumb_test.jpg
  5. * 基本操作:根据upload上传、保存到pic表,所有保存到pic表的图片,均可参与后续处理操作 
  6. */
  7. # 定义几个常用的选项
  8. $option = array
  9. (
  10. 1 => '启用',
  11. 2 => '关闭',
  12. );
  13. return array
  14. (
  15. # 表名
  16. 'name' => 'file',
  17. # 显示给用户看的名称
  18. 'lang' => '文件',
  19. 'menu' => false,
  20. # 数据结构
  21. 'struct' => array
  22. (
  23. 'id' => array
  24. (
  25. 'type' => 'int-11',
  26. 'name' => '配置ID',
  27. 'default' => '',
  28. 'desc' => '',
  29. 'match' => 'is_numeric',
  30. 'search' => 'order',
  31. 'list' => true,
  32. ),
  33. 'name' => array
  34. (
  35. 'type' => 'varchar-24',
  36. 'name' => '文件名',
  37. 'default' => '',
  38. 'desc' => '请输入文件名',
  39. 'match' => 'is_string',
  40. 'search' => 'fulltext',
  41. 'list' => true,
  42. ),
  43. 'ext' => array
  44. (
  45. 'type' => 'varchar-24',
  46. 'name' => '后缀名',
  47. 'default' => '',
  48. 'desc' => '请输入后缀名',
  49. 'match' => 'is_string',
  50. 'list' => true,
  51. ),
  52. 'file' => array
  53. (
  54. 'type' => 'varchar-100',
  55. 'name' => '访问路径',
  56. 'default' => '',
  57. 'desc' => '请输入访问路径',
  58. 'match' => 'is_string',
  59. 'list' => true,
  60. ),
  61. 'width' => array
  62. (
  63. 'type' => 'int-11',
  64. 'name' => '宽度',
  65. 'default' => '0',
  66. 'desc' => '请输入宽度',
  67. 'match' => 'option',
  68. 'list' => true,
  69. ),
  70. 'height' => array
  71. (
  72. 'type' => 'int-11',
  73. 'name' => '高度',
  74. 'default' => '0',
  75. 'desc' => '请输入高度',
  76. 'match' => 'option',
  77. 'list' => true,
  78. ),
  79. 'size' => array
  80. (
  81. 'type' => 'int-11',
  82. 'name' => '大小',
  83. 'default' => '0',
  84. 'desc' => '请输入大小',
  85. 'match' => 'option',
  86. 'list' => true,
  87. ),
  88. 'state' => array
  89. (
  90. 'type' => 'tinyint-1',
  91. 'name' => '状态',
  92. 'default' => '1',
  93. 'desc' => '请选择状态',
  94. 'match' => 'is_numeric',
  95. 'option' => $option,
  96. 'list' => true,
  97. ),
  98. 'cdate' => array
  99. (
  100. 'type' => 'int-11',
  101. 'name' => '录入时间',
  102. 'match' => array('is_numeric', time()),
  103. 'desc' => '',
  104. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  105. ),
  106. ),
  107. # request 请求接口定义
  108. 'request' => array
  109. (
  110. # info 根据文件名获取数据
  111. 'info' => array
  112. (
  113. 'where' => array
  114. (
  115. 'name' => 'is_string',
  116. ),
  117. 'type' => 'one',
  118. ),
  119. )
  120. );