pic_water.php 2.0 KB

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