source.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <?php
  2. return array
  3. (
  4. # 表名
  5. 'name' => 'source',
  6. # 显示给用户看的名称
  7. 'lang' => '合作来源',
  8. # 后台菜单排序
  9. 'order' => -100,
  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' => '来源名称',
  28. 'default' => '',
  29. 'desc' => '来源名称',
  30. 'match' => 'is_string',
  31. 'update' => 'text',
  32. 'search' => 'fulltext',
  33. 'list' => true,
  34. ),
  35. 'info' => array
  36. (
  37. 'type' => 'varchar-2000',
  38. 'name' => '来源介绍',
  39. 'default' => '',
  40. 'desc' => '来源介绍',
  41. 'match' => 'is_string',
  42. 'update' => 'textarea',
  43. 'list_name' => '来源信息',
  44. 'list' => 'Dever::load("setting/lib/manage.showSource", {id})',
  45. 'list_header' => array('width' => '60%'),
  46. ),
  47. 'num_view' => array
  48. (
  49. 'type' => 'int-11',
  50. 'name' => '访问量',
  51. 'default' => '',
  52. 'desc' => '访问量',
  53. 'match' => 'is_numeric',
  54. //'update' => 'text',
  55. 'list' => true,
  56. ),
  57. 'baoming_view' => array
  58. (
  59. 'type' => 'int-11',
  60. 'name' => '报名量',
  61. 'default' => '',
  62. 'desc' => '报名量',
  63. 'match' => 'is_numeric',
  64. //'update' => 'text',
  65. 'list' => true,
  66. ),
  67. 'state' => array
  68. (
  69. 'type' => 'tinyint-1',
  70. 'name' => '状态',
  71. 'default' => '1',
  72. 'desc' => '请选择状态',
  73. 'match' => 'is_numeric',
  74. ),
  75. 'cdate' => array
  76. (
  77. 'type' => 'int-11',
  78. 'name' => '录入时间',
  79. 'match' => array('is_numeric', time()),
  80. 'desc' => '',
  81. # 只有insert时才生效
  82. 'insert' => true,
  83. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  84. ),
  85. ),
  86. # 默认值
  87. 'default' => array
  88. (
  89. 'col' => 'name,state,cdate',
  90. 'value' => array
  91. (
  92. '"默认来源",1,' . time(),
  93. ),
  94. ),
  95. 'manage' => array
  96. (
  97. 'insert' => false,
  98. 'edit' => false,
  99. # 自定义快捷新增和编辑
  100. 'button' => array
  101. (
  102. '新增' => array('fast'),
  103. ),
  104. # 快捷更新
  105. 'list_button' => array
  106. (
  107. 'edit' => array('编辑'),
  108. ),
  109. ),
  110. 'request' => array
  111. (
  112. # 增加访问量
  113. 'incView' => array
  114. (
  115. 'type' => 'update',
  116. 'where' => array
  117. (
  118. 'id' => 'yes',
  119. ),
  120. 'set' => array
  121. (
  122. 'num_view' => array('yes', '+='),
  123. ),
  124. ),
  125. # 增加访问量
  126. 'incBaoming' => array
  127. (
  128. 'type' => 'update',
  129. 'where' => array
  130. (
  131. 'id' => 'yes',
  132. ),
  133. 'set' => array
  134. (
  135. 'baoming_view' => array('yes', '+='),
  136. ),
  137. ),
  138. ),
  139. );