pic_crop.php 2.3 KB

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