file.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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. 'order' => 9,
  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-32',
  36. 'name' => '文件名',
  37. 'default' => '',
  38. 'desc' => '请输入文件名',
  39. 'match' => 'is_string',
  40. 'search' => 'fulltext',
  41. 'list' => true,
  42. ),
  43. 'source_name' => array
  44. (
  45. 'type' => 'varchar-50',
  46. 'name' => '原文件名',
  47. 'default' => '',
  48. 'desc' => '请输入原文件名',
  49. 'match' => 'is_string',
  50. 'search' => 'fulltext',
  51. 'list' => true,
  52. ),
  53. 'key' => array
  54. (
  55. 'type' => 'varchar-32',
  56. 'name' => 'key',
  57. 'default' => '',
  58. 'desc' => 'key',
  59. 'match' => 'is_string',
  60. //'search' => 'fulltext',
  61. //'list' => true,
  62. ),
  63. 'ext' => array
  64. (
  65. 'type' => 'varchar-24',
  66. 'name' => '后缀名',
  67. 'default' => '',
  68. 'desc' => '请输入后缀名',
  69. 'match' => 'is_string',
  70. 'list' => true,
  71. ),
  72. 'file' => array
  73. (
  74. 'type' => 'varchar-150',
  75. 'name' => '访问路径',
  76. 'default' => '',
  77. 'desc' => '请输入访问路径',
  78. 'match' => 'is_string',
  79. 'list' => true,
  80. ),
  81. 'width' => array
  82. (
  83. 'type' => 'int-11',
  84. 'name' => '宽度',
  85. 'default' => '0',
  86. 'desc' => '请输入宽度',
  87. 'match' => 'option',
  88. 'list' => true,
  89. ),
  90. 'height' => array
  91. (
  92. 'type' => 'int-11',
  93. 'name' => '高度',
  94. 'default' => '0',
  95. 'desc' => '请输入高度',
  96. 'match' => 'option',
  97. 'list' => true,
  98. ),
  99. 'size' => array
  100. (
  101. 'type' => 'int-11',
  102. 'name' => '大小',
  103. 'default' => '0',
  104. 'desc' => '请输入大小',
  105. 'match' => 'option',
  106. 'list' => true,
  107. ),
  108. 'state' => array
  109. (
  110. 'type' => 'tinyint-1',
  111. 'name' => '状态',
  112. 'default' => '1',
  113. 'desc' => '请选择状态',
  114. 'match' => 'is_numeric',
  115. 'option' => $option,
  116. 'list' => true,
  117. ),
  118. 'cdate' => array
  119. (
  120. 'type' => 'int-11',
  121. 'name' => '录入时间',
  122. 'match' => array('is_numeric', time()),
  123. 'desc' => '',
  124. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  125. ),
  126. ),
  127. # request 请求接口定义
  128. 'request' => array
  129. (
  130. # info 根据文件名获取数据
  131. 'file' => array
  132. (
  133. 'where' => array
  134. (
  135. 'file' => 'is_string',
  136. ),
  137. 'type' => 'one',
  138. ),
  139. 'name' => array
  140. (
  141. 'where' => array
  142. (
  143. 'name' => 'is_string',
  144. ),
  145. 'type' => 'one',
  146. ),
  147. )
  148. );