cate.php 1.7 KB

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