info.php 4.9 KB

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