info.php 3.8 KB

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