info.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <?php
  2. $page = function()
  3. {
  4. $array = array();
  5. $info = Dever::db('ad/page')->state();
  6. if($info)
  7. {
  8. $array += $info;
  9. }
  10. return $array;
  11. };
  12. $type = array
  13. (
  14. 1 => '图片广告',
  15. 2 => '视频广告',
  16. 3 => '代码广告',
  17. 4 => '切屏广告',
  18. );
  19. return array
  20. (
  21. # 表名
  22. 'name' => 'info',
  23. # 显示给用户看的名称
  24. 'lang' => '广告位管理',
  25. 'order' => 100,
  26. 'check' => 'key',
  27. 'end' => array
  28. (
  29. 'update' => 'ad/lib/manage.upInfoCache',
  30. 'insert' => 'ad/lib/manage.upInfoCache',
  31. ),
  32. # 数据结构
  33. 'struct' => array
  34. (
  35. 'id' => array
  36. (
  37. 'type' => 'int-11',
  38. 'name' => '广告位ID',
  39. 'default' => '',
  40. 'desc' => '',
  41. 'match' => 'is_numeric',
  42. //'search' => 'order',
  43. 'order' => 'desc',
  44. 'list' => true,
  45. ),
  46. 'page_id' => array
  47. (
  48. 'type' => 'int-11',
  49. 'name' => '所属页面',
  50. 'default' => '1',
  51. 'desc' => '选择所属页面',
  52. 'match' => 'is_numeric',
  53. 'option' => $page,
  54. 'update' => 'select',
  55. 'search' => 'select',
  56. 'list' => true,
  57. ),
  58. 'name' => array
  59. (
  60. 'type' => 'varchar-60',
  61. 'name' => '广告位标题',
  62. 'default' => '',
  63. 'desc' => '请输入广告位标题',
  64. 'match' => 'is_string',
  65. 'update' => 'text',
  66. 'search' => 'fulltext',
  67. 'list' => true,
  68. 'edit' => true,
  69. ),
  70. 'key' => array
  71. (
  72. 'type' => 'varchar-800',
  73. 'name' => '广告位标识-前台将根据广告位标识来确定展示的位置,标识不能重复',
  74. 'default' => '',
  75. 'desc' => '广告位标识',
  76. 'match' => 'is_string',
  77. 'update' => 'text',
  78. 'search' => 'fulltext',
  79. 'list' => true,
  80. 'edit' => true,
  81. ),
  82. 'type' => array
  83. (
  84. 'type' => 'int-11',
  85. 'name' => '广告类型',
  86. 'default' => '1',
  87. 'desc' => '请选择广告类型',
  88. 'match' => 'is_numeric',
  89. 'option' => $type,
  90. 'update' => 'radio',
  91. 'search' => 'select',
  92. 'list' => true,
  93. ),
  94. 'reorder' => array
  95. (
  96. 'type' => 'int-11',
  97. 'name' => '排序(数值越大越靠前)',
  98. 'default' => '1',
  99. 'desc' => '请输入排序',
  100. 'match' => 'option',
  101. 'update' => 'text',
  102. 'search' => 'order',
  103. 'list_name' => '排序',
  104. 'list' => true,
  105. 'order' => 'desc',
  106. //'edit' => true,
  107. ),
  108. 'state' => array
  109. (
  110. 'type' => 'tinyint-1',
  111. 'name' => '状态',
  112. 'default' => '1',
  113. 'desc' => '请选择状态',
  114. 'match' => 'is_numeric',
  115. ),
  116. 'cdate' => array
  117. (
  118. 'type' => 'int-11',
  119. 'name' => '录入时间',
  120. 'match' => array('is_numeric', time()),
  121. 'desc' => '',
  122. # 只有insert时才生效
  123. 'insert' => true,
  124. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  125. ),
  126. ),
  127. 'manage' => array
  128. (
  129. 'delete' => false,
  130. //'edit' => false,
  131. //'insert' => $curPage ? true : false,
  132. 'list_button' => array
  133. (
  134. 'add' => array('广告投放', '"data&search_option_info_id={id}&oper_parent=info"'),
  135. 'list' => array('投放列表', '"data&search_option_info_id={id}&oper_parent=info"'),
  136. ),
  137. ),
  138. # request 请求接口定义
  139. 'request' => array
  140. (
  141. 'getAll' => array
  142. (
  143. # 匹配的正则或函数 选填项
  144. 'option' => array
  145. (
  146. 'page_id' => 'yes',
  147. 'state' => 1,
  148. ),
  149. 'type' => 'all',
  150. 'order' => array('id' => 'desc'),
  151. 'col' => '*|key',
  152. ),
  153. ),
  154. );