stat.php 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. <?php
  2. $project = function()
  3. {
  4. $array = array();
  5. $info = Dever::db('log/project')->state();
  6. if($info)
  7. {
  8. $array += $info;
  9. }
  10. return $array;
  11. };
  12. return array
  13. (
  14. # 表名
  15. 'name' => 'stat',
  16. # 显示给用户看的名称
  17. 'lang' => '广告数据统计',
  18. 'order' => 1,
  19. 'menu' => false,
  20. # 数据结构
  21. 'struct' => array
  22. (
  23. 'id' => array
  24. (
  25. 'type' => 'int-11',
  26. 'name' => 'ID',
  27. 'default' => '',
  28. 'desc' => '',
  29. 'match' => 'is_numeric',
  30. //'search' => 'order',
  31. 'order' => 'desc',
  32. //'list' => true,
  33. ),
  34. 'page_id' => array
  35. (
  36. 'type' => 'int-11',
  37. 'name' => '广告页面id',
  38. 'default' => '1',
  39. 'desc' => '广告页面id',
  40. 'match' => 'is_numeric',
  41. 'update' => 'select',
  42. //'search' => 'select',
  43. //'list' => true,
  44. ),
  45. 'info_id' => array
  46. (
  47. 'type' => 'int-11',
  48. 'name' => '广告位id',
  49. 'default' => '1',
  50. 'desc' => '广告位id',
  51. 'match' => 'is_numeric',
  52. 'update' => 'select',
  53. //'search' => 'select',
  54. //'list' => true,
  55. ),
  56. 'data_id' => array
  57. (
  58. 'type' => 'int-11',
  59. 'name' => '广告投放id',
  60. 'default' => '1',
  61. 'desc' => '广告投放id',
  62. 'match' => 'is_numeric',
  63. 'update' => 'select',
  64. //'search' => 'select',
  65. //'list' => true,
  66. ),
  67. 'year' => array
  68. (
  69. 'type' => 'int-11',
  70. 'name' => '时间',
  71. 'default' => '',
  72. 'desc' => '年',
  73. 'match' => 'is_numeric',
  74. 'update' => 'text',
  75. 'list' => '"{year}年{month}月{day}日{hour}时"',
  76. ),
  77. 'month' => array
  78. (
  79. 'type' => 'int-11',
  80. 'name' => '月',
  81. 'default' => '',
  82. 'desc' => '月',
  83. 'match' => 'is_numeric',
  84. 'update' => 'text',
  85. ),
  86. 'day' => array
  87. (
  88. 'type' => 'int-11',
  89. 'name' => '日',
  90. 'default' => '',
  91. 'desc' => '日',
  92. 'match' => 'is_numeric',
  93. 'update' => 'text',
  94. ),
  95. 'hour' => array
  96. (
  97. 'type' => 'int-11',
  98. 'name' => '小时',
  99. 'default' => '',
  100. 'desc' => '小时',
  101. 'match' => 'is_numeric',
  102. 'update' => 'text',
  103. ),
  104. 'time' => array
  105. (
  106. 'type' => 'int-11',
  107. 'name' => '时间',
  108. 'default' => '',
  109. 'desc' => '时间',
  110. 'match' => 'is_numeric',
  111. 'search' => 'time',
  112. 'update' => 'text',
  113. ),
  114. 'pv_view' => array
  115. (
  116. 'type' => 'int-11',
  117. 'name' => '广告访问量',
  118. 'default' => '',
  119. 'desc' => '广告访问量',
  120. 'match' => 'is_numeric',
  121. 'update' => 'text',
  122. //'search' => 'order',
  123. 'list_name' => '数据统计',
  124. 'list' => 'Dever::load("ad/lib/manage.getNum", {id})',
  125. ),
  126. 'uv_view' => array
  127. (
  128. 'type' => 'int-11',
  129. 'name' => '广告访问量(UV)',
  130. 'default' => '',
  131. 'desc' => '广告访问量',
  132. 'match' => 'is_numeric',
  133. 'update' => 'text',
  134. //'search' => 'order',
  135. //'list' => true,
  136. ),
  137. 'pv_click' => array
  138. (
  139. 'type' => 'int-11',
  140. 'name' => '广告点击量',
  141. 'default' => '',
  142. 'desc' => '广告点击量',
  143. 'match' => 'is_numeric',
  144. 'update' => 'text',
  145. //'search' => 'order',
  146. //'list' => true,
  147. ),
  148. 'uv_click' => array
  149. (
  150. 'type' => 'int-11',
  151. 'name' => '广告点击量(UV)',
  152. 'default' => '',
  153. 'desc' => '广告点击量',
  154. 'match' => 'is_numeric',
  155. 'update' => 'text',
  156. //'search' => 'order',
  157. //'list' => true,
  158. ),
  159. 'state' => array
  160. (
  161. 'type' => 'tinyint-1',
  162. 'name' => '状态',
  163. 'default' => '1',
  164. 'desc' => '请选择状态',
  165. 'match' => 'is_numeric',
  166. ),
  167. 'cdate' => array
  168. (
  169. 'type' => 'int-11',
  170. 'name' => '录入时间',
  171. 'match' => array('is_numeric', time()),
  172. 'desc' => '',
  173. # 只有insert时才生效
  174. 'insert' => true,
  175. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  176. ),
  177. ),
  178. 'manage' => array
  179. (
  180. 'delete' => false,
  181. 'edit' => false,
  182. 'insert' => false,
  183. ),
  184. # request 请求接口定义
  185. 'request' => array
  186. (
  187. 'sum' => array
  188. (
  189. # 匹配的正则或函数 选填项
  190. 'option' => array
  191. (
  192. 'data_id' => 'yes',
  193. 'state' => 1,
  194. ),
  195. 'type' => 'one',
  196. 'order' => array('id' => 'desc'),
  197. //'group' => 'data_id',
  198. 'col' => 'id,sum(pv_view) as pv_view,sum(pv_click) as pv_click,sum(uv_view) as uv_view,sum(uv_click) as uv_click,cdate,data_id,info_id,page_id,time',
  199. ),
  200. ),
  201. );