info.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <?php
  2. $link = function()
  3. {
  4. $array = array
  5. (
  6. -1 => array('id' => -1, 'name' => '通用'),
  7. );
  8. $info = Dever::db('source/link')->state();
  9. if($info)
  10. {
  11. $array += $info;
  12. }
  13. return $array;
  14. };
  15. $cate = function()
  16. {
  17. $array = array();
  18. $info = Dever::db('journal/cate')->state();
  19. if($info)
  20. {
  21. $array += $info;
  22. }
  23. return $array;
  24. };
  25. $type = array
  26. (
  27. //1 => '购买小刊',
  28. 2 => '购买小刊兑换码',
  29. );
  30. return array
  31. (
  32. # 表名
  33. 'name' => 'info',
  34. # 显示给用户看的名称
  35. 'lang' => '渠道管理',
  36. 'order' => 10,
  37. 'end' => array
  38. (
  39. 'insert' => 'source/lib/manage.updateCode',
  40. 'update' => 'source/lib/manage.updateCode',
  41. ),
  42. # 数据结构
  43. 'struct' => array
  44. (
  45. 'id' => array
  46. (
  47. 'type' => 'int-11',
  48. 'name' => 'ID',
  49. 'default' => '',
  50. 'desc' => '',
  51. 'match' => 'is_numeric',
  52. 'list' => true,
  53. ),
  54. 'name' => array
  55. (
  56. 'type' => 'varchar-80',
  57. 'name' => '名称',
  58. 'default' => '',
  59. 'desc' => '请输入名称',
  60. 'match' => 'is_string',
  61. 'update' => 'text',
  62. 'search' => 'fulltext',
  63. 'list' => true,
  64. ),
  65. 'cate_id' => array
  66. (
  67. 'type' => 'int-11',
  68. 'name' => '小刊分类',
  69. 'default' => '1',
  70. 'desc' => '小刊分类',
  71. 'match' => 'is_numeric',
  72. 'update' => 'select',
  73. 'option' => $cate,
  74. 'search' => 'select',
  75. 'list' => true,
  76. ),
  77. 'type' => array
  78. (
  79. 'type' => 'int-11',
  80. 'name' => '类型',
  81. 'default' => '1',
  82. 'desc' => '类型',
  83. 'match' => 'is_numeric',
  84. 'update' => 'select',
  85. 'option' => $type,
  86. 'search' => 'select',
  87. 'list' => true,
  88. ),
  89. 'link_id' => array
  90. (
  91. 'type' => 'int-11',
  92. 'name' => '推广链接',
  93. 'default' => '-1',
  94. 'desc' => '推广链接',
  95. 'match' => 'is_numeric',
  96. 'update' => 'select',
  97. 'option' => $link,
  98. 'search' => 'select',
  99. 'list' => true,
  100. ),
  101. 'code' => array
  102. (
  103. 'type' => 'varchar-500',
  104. 'name' => '渠道链接',
  105. 'default' => '',
  106. 'desc' => '渠道链接',
  107. 'match' => 'option',
  108. //'update' => 'textarea',
  109. //'list' => 'Dever::load("source/lib/manage.show", "{id}")',
  110. 'list' => true,
  111. ),
  112. 'state' => array
  113. (
  114. 'type' => 'tinyint-1',
  115. 'name' => '状态',
  116. 'default' => '1',
  117. 'desc' => '请选择状态',
  118. 'match' => 'is_numeric',
  119. ),
  120. 'cdate' => array
  121. (
  122. 'type' => 'int-11',
  123. 'name' => '录入时间',
  124. 'match' => array('is_numeric', time()),
  125. 'desc' => '',
  126. # 只有insert时才生效
  127. 'insert' => true,
  128. ),
  129. ),
  130. # 默认值
  131. 'default' => array
  132. (
  133. 'col' => 'name,link_id,state,cdate',
  134. 'value' => array
  135. (
  136. '"官方",-1,1,' . time(),
  137. ),
  138. ),
  139. 'manage' => array
  140. (
  141. //'delete' => false,
  142. //'edit' => false,
  143. # 列表
  144. 'list_buttons' => array
  145. (
  146. //'list' => array('渠道统计', '"stat&search_option_info_id={id}&oper_parent=info"'),
  147. ),
  148. ),
  149. );