cate.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <?php
  2. # 获取分类权限
  3. $status = Dever::config('base')->status;
  4. return array
  5. (
  6. # 表名
  7. 'name' => 'cate',
  8. # 显示给用户看的名称
  9. 'lang' => '按钮分类',
  10. # 后台菜单排序
  11. 'order' => 99,
  12. # 数据结构
  13. 'struct' => array
  14. (
  15. 'id' => array
  16. (
  17. 'type' => 'int-11',
  18. 'name' => 'ID',
  19. 'default' => '',
  20. 'desc' => '',
  21. 'match' => 'is_numeric',
  22. 'search' => 'order',
  23. 'list' => true,
  24. 'order' => 'desc',
  25. ),
  26. 'name' => array
  27. (
  28. 'type' => 'varchar-32',
  29. 'name' => '分类名称',
  30. 'default' => '',
  31. 'desc' => '请输入名称',
  32. 'match' => 'is_string',
  33. 'update' => 'text',
  34. 'search' => 'fulltext',
  35. 'list' => true,
  36. ),
  37. 'status' => array
  38. (
  39. 'type' => 'int-11',
  40. 'name' => '上线状态',
  41. 'default' => '1',
  42. 'desc' => '上线状态',
  43. 'match' => 'is_numeric',
  44. //'update' => 'select',
  45. 'option' => $status,
  46. 'search' => 'select',
  47. 'list' => true,
  48. 'edit' => true,
  49. ),
  50. 'reorder' => array
  51. (
  52. 'type' => 'int-11',
  53. 'name' => '排序(数值越大越靠前)',
  54. 'default' => '1',
  55. 'desc' => '请输入排序',
  56. 'match' => 'option',
  57. //'update' => 'text',
  58. 'search' => 'order',
  59. 'list' => true,
  60. 'order' => 'desc',
  61. 'edit' => true,
  62. ),
  63. 'state' => array
  64. (
  65. 'type' => 'tinyint-1',
  66. 'name' => '状态',
  67. 'default' => '1',
  68. 'desc' => '请选择状态',
  69. 'match' => 'is_numeric',
  70. ),
  71. 'cdate' => array
  72. (
  73. 'type' => 'int-11',
  74. 'name' => '录入时间',
  75. 'match' => array('is_numeric', time()),
  76. 'desc' => '',
  77. # 只有insert时才生效
  78. 'insert' => true,
  79. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  80. ),
  81. ),
  82. # 默认值
  83. 'default' => array
  84. (
  85. 'col' => 'name,reorder,state,cdate',
  86. 'value' => array
  87. (
  88. '"工具箱",1,1,' . time(),
  89. ),
  90. ),
  91. 'manage' => array
  92. (
  93. ),
  94. 'request' => array
  95. (
  96. ),
  97. );