info.php 3.0 KB

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