source.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <?php
  2. return array
  3. (
  4. # 表名
  5. 'name' => 'source',
  6. # 显示给用户看的名称
  7. 'lang' => '文章来源',
  8. # 后台菜单排序
  9. 'order' => 8,
  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' => '来源名称-长度不能超过16个汉字',
  29. 'default' => '',
  30. 'desc' => '请输入来源名称,长度不能超过16个汉字',
  31. 'match' => Dever::rule('name', '/u', '1,16'),
  32. 'update' => 'text',
  33. 'search' => 'fulltext',
  34. 'list' => true,
  35. ),
  36. 'link' => array
  37. (
  38. 'type' => 'varchar-500',
  39. 'name' => '来源链接',
  40. 'default' => '',
  41. 'desc' => '请输入来源名称',
  42. 'match' => 'is_string',
  43. 'update' => 'text',
  44. 'search' => 'fulltext',
  45. 'list' => true,
  46. ),
  47. 'reorder' => array
  48. (
  49. 'type' => 'int-11',
  50. 'name' => '排序(数值越大越靠前)',
  51. 'default' => '1',
  52. 'desc' => '请输入排序',
  53. 'match' => 'option',
  54. 'update' => 'text',
  55. 'search' => 'order',
  56. 'list' => true,
  57. 'order' => 'desc',
  58. 'edit' => true,
  59. ),
  60. 'state' => array
  61. (
  62. 'type' => 'tinyint-1',
  63. 'name' => '状态',
  64. 'default' => '1',
  65. 'desc' => '请选择状态',
  66. 'match' => 'is_numeric',
  67. ),
  68. 'cdate' => array
  69. (
  70. 'type' => 'int-11',
  71. 'name' => '录入时间',
  72. 'match' => array('is_numeric', time()),
  73. 'desc' => '',
  74. # 只有insert时才生效
  75. 'insert' => true,
  76. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  77. ),
  78. ),
  79. # 默认值
  80. 'default' => array
  81. (
  82. 'col' => 'name,state,cdate',
  83. 'value' => array
  84. (
  85. '"默认来源",1,' . time(),
  86. ),
  87. ),
  88. 'manage' => array
  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. 'request' => array
  104. (
  105. 'getAll' => array
  106. (
  107. # 匹配的正则或函数 选填项
  108. 'option' => array
  109. (
  110. 'ids' => array('yes-id', 'in'),
  111. 'name' => array('yes', 'like'),
  112. 'id' => 'yes',
  113. 'state' => 1,
  114. ),
  115. 'type' => 'all',
  116. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  117. 'limit' => '0,1000',
  118. 'col' => 'name as name, id, id as value, "" as selected, "" as disabled|id',
  119. ),
  120. ),
  121. );