stat.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <?php
  2. $info = function()
  3. {
  4. $array = array();
  5. $info = Dever::db('source/info')->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' => 10,
  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. ),
  31. 'uid' => array
  32. (
  33. 'type' => 'int-11',
  34. 'name' => '用户名',
  35. 'default' => '0',
  36. 'desc' => '请选择用户',
  37. 'match' => 'is_numeric',
  38. //'update' => 'select',
  39. //'search' => 'select',
  40. 'search' => array
  41. (
  42. 'api' => 'passport/user-all',
  43. 'col' => 'username',
  44. 'result' => 'id',
  45. ),
  46. 'list' => '{uid} > 0 ? Dever::load("passport/user-one#username", {uid}) : "匿名用户"',
  47. ),
  48. 'info_id' => array
  49. (
  50. 'type' => 'int-11',
  51. 'name' => '渠道',
  52. 'default' => '1',
  53. 'desc' => '渠道',
  54. 'match' => 'is_numeric',
  55. 'update' => 'select',
  56. 'option' => $info,
  57. 'search' => 'select',
  58. 'list' => true,
  59. ),
  60. 'day' => array
  61. (
  62. 'type' => 'int-11',
  63. 'name' => '统计时间',
  64. 'default' => '',
  65. 'desc' => '统计时间',
  66. 'match' => 'is_numeric',
  67. 'update' => 'select',
  68. 'list' => true,
  69. ),
  70. 'pv' => array
  71. (
  72. 'type' => 'int-11',
  73. 'name' => 'pv数',
  74. 'default' => '',
  75. 'desc' => 'pv数',
  76. 'match' => 'option',
  77. 'update' => 'text',
  78. 'list' => true,
  79. ),
  80. 'uv' => array
  81. (
  82. 'type' => 'int-11',
  83. 'name' => 'uv数',
  84. 'default' => '',
  85. 'desc' => 'uv数',
  86. 'match' => 'option',
  87. 'update' => 'text',
  88. 'list' => true,
  89. ),
  90. 'order' => array
  91. (
  92. 'type' => 'int-11',
  93. 'name' => '下单数',
  94. 'default' => '',
  95. 'desc' => '下单数',
  96. 'match' => 'option',
  97. 'update' => 'text',
  98. 'list' => true,
  99. ),
  100. 'state' => array
  101. (
  102. 'type' => 'tinyint-1',
  103. 'name' => '状态',
  104. 'default' => '1',
  105. 'desc' => '请选择状态',
  106. 'match' => 'is_numeric',
  107. ),
  108. 'cdate' => array
  109. (
  110. 'type' => 'int-11',
  111. 'name' => '录入时间',
  112. 'match' => array('is_numeric', time()),
  113. 'desc' => '',
  114. # 只有insert时才生效
  115. 'insert' => true,
  116. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  117. ),
  118. ),
  119. 'manage' => array
  120. (
  121. 'delete' => false,
  122. 'edit' => false,
  123. 'insert' => false,
  124. ),
  125. # request 请求接口定义
  126. 'request' => array
  127. (
  128. 'getNew' => array
  129. (
  130. # 匹配的正则或函数 选填项
  131. 'option' => array
  132. (
  133. 'config_id' => 'yes',
  134. 'action_id' => 'yes',
  135. 'uid' => 'yes',
  136. 'status' => 'yes',
  137. 'state' => 1,
  138. ),
  139. 'type' => 'one',
  140. 'order' => array('cdate' => 'desc'),
  141. 'col' => '*',
  142. ),
  143. 'getNewTotal' => array
  144. (
  145. # 匹配的正则或函数 选填项
  146. 'option' => array
  147. (
  148. 'config_id' => 'yes',
  149. 'action_id' => 'yes',
  150. 'uid' => 'yes',
  151. 'status' => 'yes',
  152. 'state' => 1,
  153. 'start' => array('yes-cdate', '>='),
  154. 'end' => array('yes-cdate', '<='),
  155. ),
  156. 'type' => 'count',
  157. 'order' => array('cdate' => 'desc'),
  158. 'col' => 'count(1) as total',
  159. ),
  160. )
  161. );