unit_type.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <?php
  2. return array
  3. (
  4. # 表名
  5. 'name' => 'unit_type',
  6. # 显示给用户看的名称
  7. 'lang' => '单位分类',
  8. # 是否显示在后台菜单
  9. 'order' => 10,
  10. 'menu' => false,
  11. # 数据结构
  12. 'struct' => array
  13. (
  14. 'id' => array
  15. (
  16. 'type' => 'int-11',
  17. 'name' => 'ID',
  18. 'default' => '',
  19. 'desc' => '',
  20. 'match' => 'is_numeric',
  21. 'list' => true,
  22. 'order' => 'asc',
  23. ),
  24. 'name' => array
  25. (
  26. 'type' => 'varchar-150',
  27. 'name' => '分类名称',
  28. 'default' => '',
  29. 'desc' => '分类名称',
  30. 'match' => 'is_string',
  31. 'update' => 'text',
  32. 'search' => 'fulltext',
  33. 'list' => true,
  34. 'edit' => true,
  35. ),
  36. 'en_name' => array
  37. (
  38. 'type' => 'varchar-150',
  39. 'name' => '分类英文名称',
  40. 'default' => '',
  41. 'desc' => '分类英文名称',
  42. 'match' => 'is_string',
  43. 'update' => 'text',
  44. 'search' => 'fulltext',
  45. 'list' => true,
  46. 'edit' => true,
  47. ),
  48. 'reorder' => array
  49. (
  50. 'type' => 'int-11',
  51. 'name' => '排序(数值越大越靠前)',
  52. 'default' => '1',
  53. 'desc' => '请输入排序',
  54. 'match' => 'option',
  55. //'update' => 'text',
  56. 'search' => 'order',
  57. 'list_name' => '排序',
  58. 'list' => true,
  59. 'order' => 'desc',
  60. 'edit' => true,
  61. ),
  62. 'state' => array
  63. (
  64. 'type' => 'tinyint-1',
  65. 'name' => '状态',
  66. 'default' => '1',
  67. 'desc' => '请选择状态',
  68. 'match' => 'is_numeric',
  69. ),
  70. 'cdate' => array
  71. (
  72. 'type' => 'int-11',
  73. 'name' => '录入时间',
  74. 'match' => array('is_numeric', time()),
  75. 'desc' => '',
  76. # 只有insert时才生效
  77. 'insert' => true,
  78. //'search' => 'date',
  79. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  80. ),
  81. ),
  82. 'manage' => array
  83. (
  84. 'insert' => false,
  85. 'edit' => false,
  86. # 自定义快捷新增和编辑
  87. 'button' => array
  88. (
  89. '新增' => array('fast'),
  90. ),
  91. 'list_button' => array
  92. (
  93. 'edit' => array('编辑'),
  94. )
  95. ),
  96. 'default' => array
  97. (
  98. 'col' => 'id,name,en_name,reorder,state,cdate',
  99. 'value' => array
  100. (
  101. '1,"重量单位","weight",1000,1,' . DEVER_TIME,
  102. '2,"数量单位","number",900,1,' . DEVER_TIME,
  103. '3,"长度单位","length",800,1,' . DEVER_TIME,
  104. '4,"面积单位","area",700,1,' . DEVER_TIME,
  105. '5,"体积单位","voiume",600,1,' . DEVER_TIME,
  106. '6,"容积单位","capality",500,1,' . DEVER_TIME,
  107. ),
  108. ),
  109. 'request' => array
  110. (
  111. 'getAll' => array
  112. (
  113. # 匹配的正则或函数 选填项
  114. 'option' => array
  115. (
  116. 'state' => 1,
  117. ),
  118. 'type' => 'all',
  119. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  120. 'col' => 'id,id as value, name',
  121. ),
  122. )
  123. );