c11eaf893651edea14619c8231295cfeb71b5395.svn-base 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?php
  2. /**
  3. * 上传表
  4. */
  5. # 定义几个常用的选项
  6. $option = array
  7. (
  8. 1 => '启用',
  9. 2 => '关闭',
  10. );
  11. return array
  12. (
  13. # 表名
  14. 'name' => 'crop',
  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. 'state' => array
  63. (
  64. 'type' => 'tinyint-1',
  65. 'name' => '状态',
  66. 'default' => '1',
  67. 'desc' => '请选择状态',
  68. 'match' => 'is_numeric',
  69. 'option' => $option,
  70. 'update' => 'radio',
  71. 'list' => true,
  72. ),
  73. 'cdate' => array
  74. (
  75. 'type' => 'int-11',
  76. 'name' => '录入时间',
  77. 'match' => array('is_numeric', time()),
  78. 'desc' => '',
  79. # 只有insert时才生效
  80. 'insert' => true,
  81. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  82. ),
  83. ),
  84. # request 请求接口定义
  85. 'request' => array
  86. (
  87. # info 取一条正常的数据
  88. 'info' => array
  89. (
  90. # 匹配的正则或函数 必填项
  91. 'where' => array
  92. (
  93. 'id' => 'is_numeric',
  94. 'state' => 1,
  95. ),
  96. 'type' => 'one',
  97. ),
  98. ),
  99. );