pic_thumb.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <?php
  2. /**
  3. * 上传表
  4. */
  5. # 定义几个常用的选项
  6. $option = array
  7. (
  8. 1 => '启用',
  9. 2 => '关闭',
  10. );
  11. return array
  12. (
  13. # 表名
  14. 'name' => 'pic_thumb',
  15. # 显示给用户看的名称
  16. 'lang' => '图片缩略配置',
  17. 'menu' => false,
  18. # 数据结构
  19. 'struct' => array
  20. (
  21. 'id' => array
  22. (
  23. 'type' => 'int-11',
  24. 'name' => '配置ID',
  25. 'default' => '',
  26. 'desc' => '',
  27. 'match' => 'is_numeric',
  28. 'search' => 'order',
  29. 'list' => true,
  30. ),
  31. 'name' => array
  32. (
  33. 'type' => 'varchar-24',
  34. 'name' => '配置名',
  35. 'default' => '',
  36. 'desc' => '请输入配置名',
  37. 'match' => 'is_string',
  38. 'update' => 'text',
  39. 'search' => 'fulltext',
  40. 'list' => true,
  41. ),
  42. 'width' => array
  43. (
  44. 'type' => 'int-11',
  45. 'name' => '宽度',
  46. 'default' => '0',
  47. 'desc' => '请输入宽度',
  48. 'match' => 'option',
  49. 'update' => 'text',
  50. 'list' => true,
  51. ),
  52. 'height' => array
  53. (
  54. 'type' => 'int-11',
  55. 'name' => '高度',
  56. 'default' => '0',
  57. 'desc' => '请输入高度',
  58. 'match' => 'option',
  59. 'update' => 'text',
  60. 'list' => true,
  61. ),
  62. 'compress' => array
  63. (
  64. 'type' => 'int-11',
  65. 'name' => '压缩质量-为空或者小于等于0则不进行压缩',
  66. 'default' => '0',
  67. 'desc' => '请输入压缩质量',
  68. 'match' => 'option',
  69. 'update' => 'text',
  70. 'list' => true,
  71. ),
  72. 'state' => array
  73. (
  74. 'type' => 'tinyint-1',
  75. 'name' => '状态',
  76. 'default' => '1',
  77. 'desc' => '请选择状态',
  78. 'match' => 'is_numeric',
  79. ),
  80. 'cdate' => array
  81. (
  82. 'type' => 'int-11',
  83. 'name' => '录入时间',
  84. 'match' => array('is_numeric', time()),
  85. 'desc' => '',
  86. # 只有insert时才生效
  87. 'insert' => true,
  88. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  89. ),
  90. ),
  91. # 默认值
  92. /*
  93. 'default' => array
  94. (
  95. 'col' => 'name,width,height,state,cdate',
  96. 'value' => array
  97. (
  98. '"660*330",660,330,1,' . time(),
  99. '"330*165",330,165,1,' . time(),
  100. '"1340*760",1340,760,1,' . time(),
  101. '"420*420",420,420,1,' . time(),
  102. '"300*140",300,140,1,' . time(),
  103. '"580*230",580,230,1,' . time(),
  104. ),
  105. ),
  106. */
  107. # request 请求接口定义
  108. 'request' => array
  109. (
  110. # info 取一条正常的数据
  111. 'info' => array
  112. (
  113. # 匹配的正则或函数 必填项
  114. 'where' => array
  115. (
  116. 'id' => 'is_numeric',
  117. 'state' => 1,
  118. ),
  119. 'type' => 'one',
  120. ),
  121. ),
  122. );