author.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <?php
  2. return array
  3. (
  4. # 表名
  5. 'name' => 'author',
  6. # 显示给用户看的名称
  7. 'lang' => '作者管理',
  8. # 后台菜单排序
  9. 'order' => 1,
  10. # 数据结构
  11. 'struct' => array
  12. (
  13. 'id' => array
  14. (
  15. 'type' => 'int-11',
  16. 'name' => 'ID',
  17. 'default' => '',
  18. 'desc' => '',
  19. 'match' => 'is_numeric',
  20. 'search' => 'order',
  21. 'list' => true,
  22. 'order' => 'desc',
  23. ),
  24. 'name' => array
  25. (
  26. 'type' => 'varchar-32',
  27. 'name' => '作者名称-长度不能超过16个字',
  28. 'default' => '',
  29. 'desc' => '请输入作者名称,长度不能超过16个字',
  30. 'match' => Dever::rule('name', '/u', '1,16'),
  31. 'update' => 'text',
  32. 'search' => 'fulltext',
  33. 'list' => true,
  34. ),
  35. 'avatar' => array
  36. (
  37. 'type' => 'varchar-150',
  38. 'name' => '头像-图片尺寸380*380px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  39. 'default' => '',
  40. 'desc' => '头像',
  41. 'match' => 'is_string',
  42. 'update' => 'image',
  43. 'key' => '1',
  44. 'place' => '380',
  45. ),
  46. 'reorder' => array
  47. (
  48. 'type' => 'int-11',
  49. 'name' => '排序(数值越大越靠前)',
  50. 'default' => '1',
  51. 'desc' => '请输入排序',
  52. 'match' => 'option',
  53. 'update' => 'text',
  54. 'search' => 'order',
  55. 'list' => true,
  56. 'order' => 'desc',
  57. 'edit' => true,
  58. ),
  59. 'state' => array
  60. (
  61. 'type' => 'tinyint-1',
  62. 'name' => '状态',
  63. 'default' => '1',
  64. 'desc' => '请选择状态',
  65. 'match' => 'is_numeric',
  66. ),
  67. 'cdate' => array
  68. (
  69. 'type' => 'int-11',
  70. 'name' => '录入时间',
  71. 'match' => array('is_numeric', time()),
  72. 'desc' => '',
  73. # 只有insert时才生效
  74. 'insert' => true,
  75. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  76. ),
  77. ),
  78. # 默认值
  79. 'default' => array
  80. (
  81. 'col' => 'name,state,cdate',
  82. 'value' => array
  83. (
  84. '"默认作者",1,' . time(),
  85. ),
  86. ),
  87. 'manage' => array
  88. (
  89. /*
  90. 'insert' => false,
  91. 'edit' => false,
  92. # 自定义快捷新增和编辑
  93. 'button' => array
  94. (
  95. '新增' => array('fast'),
  96. ),
  97. # 快捷更新
  98. 'list_button' => array
  99. (
  100. 'edit' => array('编辑'),
  101. ),
  102. */
  103. ),
  104. 'request' => array
  105. (
  106. 'getAll' => array
  107. (
  108. # 匹配的正则或函数 选填项
  109. 'option' => array
  110. (
  111. 'ids' => array('yes-id', 'in'),
  112. 'name' => array('yes', 'like'),
  113. 'id' => 'yes',
  114. 'state' => 1,
  115. ),
  116. 'type' => 'all',
  117. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  118. 'limit' => '0,1000',
  119. 'col' => 'name as name, id, id as value, "" as selected, "" as disabled|id',
  120. ),
  121. ),
  122. );