source.php 3.3 KB

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