author.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <?php
  2. return array
  3. (
  4. # 表名
  5. 'name' => 'author',
  6. # 显示给用户看的名称
  7. 'lang' => '作者管理',
  8. # 后台菜单排序
  9. 'order' => 8,
  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. 'desc' => array
  36. (
  37. 'type' => 'varchar-500',
  38. 'name' => '介绍',
  39. 'default' => '',
  40. 'desc' => '介绍',
  41. 'match' => 'is_string',
  42. 'update' => 'textarea',
  43. ),
  44. 'avatar' => array
  45. (
  46. 'type' => 'varchar-150',
  47. 'name' => '作者头像-图片尺寸150*150px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
  48. 'default' => '',
  49. 'desc' => '作者头像',
  50. 'match' => 'option',
  51. 'update' => 'image',
  52. 'key' => '1',
  53. 'place' => '150*150',
  54. ),
  55. 'link' => array
  56. (
  57. 'type' => 'varchar-150',
  58. 'name' => '链接',
  59. 'default' => '',
  60. 'desc' => '链接',
  61. 'match' => 'option',
  62. 'update' => 'text',
  63. //'search' => 'fulltext',
  64. //'list' => true,
  65. ),
  66. 'reorder' => array
  67. (
  68. 'type' => 'int-11',
  69. 'name' => '排序(数值越大越靠前)',
  70. 'default' => '1',
  71. 'desc' => '请输入排序',
  72. 'match' => 'option',
  73. 'update' => 'text',
  74. 'search' => 'order',
  75. 'list' => true,
  76. 'order' => 'desc',
  77. 'edit' => true,
  78. ),
  79. 'state' => array
  80. (
  81. 'type' => 'tinyint-1',
  82. 'name' => '状态',
  83. 'default' => '1',
  84. 'desc' => '请选择状态',
  85. 'match' => 'is_numeric',
  86. ),
  87. 'cdate' => array
  88. (
  89. 'type' => 'int-11',
  90. 'name' => '录入时间',
  91. 'match' => array('is_numeric', time()),
  92. 'desc' => '',
  93. # 只有insert时才生效
  94. 'insert' => true,
  95. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  96. ),
  97. ),
  98. # 默认值
  99. 'default' => array
  100. (
  101. 'col' => 'name,state,cdate',
  102. 'value' => array
  103. (
  104. '"默认作者",1,' . time(),
  105. ),
  106. ),
  107. 'manage' => array
  108. (
  109. 'insert' => false,
  110. 'edit' => false,
  111. # 自定义快捷新增和编辑
  112. 'button' => array
  113. (
  114. '新增' => array('fast'),
  115. ),
  116. # 快捷更新
  117. 'list_button' => array
  118. (
  119. 'edit' => array('编辑'),
  120. ),
  121. ),
  122. 'request' => array
  123. (
  124. 'getAll' => array
  125. (
  126. # 匹配的正则或函数 选填项
  127. 'option' => array
  128. (
  129. 'ids' => array('yes-id', 'in'),
  130. 'name' => array('yes', 'like'),
  131. 'id' => 'yes',
  132. 'state' => 1,
  133. ),
  134. 'type' => 'all',
  135. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  136. 'limit' => '0,1000',
  137. 'col' => 'name as name, id, id as value, "" as selected, "" as disabled|id',
  138. ),
  139. ),
  140. );