news_cate.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <?php
  2. return array
  3. (
  4. # 表名
  5. 'name' => 'news_cate',
  6. # 显示给用户看的名称
  7. 'lang' => '新闻分类',
  8. # 后台菜单排序
  9. 'order' => 9,
  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. 'search' => 'order',
  22. 'list' => true,
  23. 'order' => 'desc',
  24. ),
  25. 'name' => array
  26. (
  27. 'type' => 'varchar-32',
  28. 'name' => '分类名称',
  29. 'default' => '',
  30. 'desc' => '请输入名称',
  31. 'match' => 'is_string',
  32. 'update' => 'text',
  33. 'search' => 'fulltext',
  34. 'list' => true,
  35. ),
  36. 'reorder' => array
  37. (
  38. 'type' => 'int-11',
  39. 'name' => '排序(数值越大越靠前)',
  40. 'default' => '1',
  41. 'desc' => '请输入排序',
  42. 'match' => 'option',
  43. 'update' => 'text',
  44. 'search' => 'order',
  45. 'list' => true,
  46. 'order' => 'desc',
  47. 'edit' => true,
  48. ),
  49. 'state' => array
  50. (
  51. 'type' => 'tinyint-1',
  52. 'name' => '状态',
  53. 'default' => '1',
  54. 'desc' => '请选择状态',
  55. 'match' => 'is_numeric',
  56. ),
  57. 'cdate' => array
  58. (
  59. 'type' => 'int-11',
  60. 'name' => '录入时间',
  61. 'match' => array('is_numeric', time()),
  62. 'desc' => '',
  63. # 只有insert时才生效
  64. 'insert' => true,
  65. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  66. ),
  67. ),
  68. # 默认值
  69. 'default' => array
  70. (
  71. 'col' => 'name,reorder,cdate',
  72. 'value' => array
  73. (
  74. '"默认分类",100,' . time(),
  75. ),
  76. ),
  77. 'manage' => array
  78. (
  79. 'lang' => 'name',
  80. 'insert' => false,
  81. 'edit' => false,
  82. # 自定义快捷新增和编辑
  83. 'button' => array
  84. (
  85. '新增' => array('fast'),
  86. ),
  87. # 快捷更新
  88. 'list_button' => array
  89. (
  90. 'edit' => array('编辑'),
  91. ),
  92. ),
  93. 'request' => array
  94. (
  95. 'getAll' => array
  96. (
  97. # 匹配的正则或函数 选填项
  98. 'option' => array
  99. (
  100. 'state' => 1,
  101. ),
  102. 'type' => 'all',
  103. 'order' => array('reorder' => 'desc','id' => 'desc'),
  104. 'col' => '*',
  105. ),
  106. ),
  107. );