member_stat.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <?php
  2. if (Dever::load('manage/auth')->checkFunc('bill.member_stat', 'edit1', '导出数据')) {
  3. $excel = true;
  4. }else{
  5. $excel = false;
  6. }
  7. $config = array
  8. (
  9. # 表名
  10. 'name' => 'member_stat',
  11. # 显示给用户看的名称
  12. 'lang' => '代理商统计',
  13. 'order' => -10,
  14. # 数据结构 不同的字段放这里
  15. 'struct' => array
  16. (
  17. 'id' => array
  18. (
  19. 'type' => 'int-11',
  20. 'name' => 'ID',
  21. 'default' => '',
  22. 'desc' => '',
  23. 'match' => 'is_numeric',
  24. //'list' => true,
  25. ),
  26. 'day' => array
  27. (
  28. 'type' => 'int-11',
  29. 'name' => '日期',
  30. 'default' => '',
  31. 'match' => 'is_numeric',
  32. 'desc' => '',
  33. 'search' => 'day',
  34. 'search_button' => array
  35. (
  36. 'sum' => 'num,city_num,county_num,town_num,ck_num,xk_num,cf_num,cv_num',
  37. 'option' => array(
  38. 'day' => '按天',
  39. 'week' => '按周',
  40. 'month' => '按月',
  41. ),
  42. 'group' => '',
  43. ),
  44. 'order' => 'desc',
  45. 'list' => 'Dever::showDay("{day}")',
  46. ),
  47. 'num' => array
  48. (
  49. 'type' => 'int-11',
  50. 'name' => '新增代理商',
  51. 'default' => '0',
  52. 'desc' => '新增代理商',
  53. 'match' => 'is_numeric',
  54. 'search' => 'order',
  55. 'list' => true,
  56. ),
  57. 'city_num' => array
  58. (
  59. 'type' => 'int-11',
  60. 'name' => '城市代理商',
  61. 'default' => '0',
  62. 'desc' => '城市代理商',
  63. 'match' => 'is_numeric',
  64. 'search' => 'order',
  65. 'list' => true,
  66. ),
  67. 'county_num' => array
  68. (
  69. 'type' => 'int-11',
  70. 'name' => '区县代理商',
  71. 'default' => '0',
  72. 'desc' => '区县代理商',
  73. 'match' => 'is_numeric',
  74. 'search' => 'order',
  75. 'list' => true,
  76. ),
  77. 'town_num' => array
  78. (
  79. 'type' => 'int-11',
  80. 'name' => '街道代理商',
  81. 'default' => '0',
  82. 'desc' => '街道代理商',
  83. 'match' => 'is_numeric',
  84. 'search' => 'order',
  85. 'list' => true,
  86. ),
  87. 'ck_num' => array
  88. (
  89. 'type' => 'int-11',
  90. 'name' => '创客',
  91. 'default' => '0',
  92. 'desc' => '创客',
  93. 'match' => 'is_numeric',
  94. 'search' => 'order',
  95. 'list' => true,
  96. ),
  97. 'xk_num' => array
  98. (
  99. 'type' => 'int-11',
  100. 'name' => '消客',
  101. 'default' => '0',
  102. 'desc' => '消客',
  103. 'match' => 'is_numeric',
  104. 'search' => 'order',
  105. 'list' => true,
  106. ),
  107. 'cf_num' => array
  108. (
  109. 'type' => 'int-11',
  110. 'name' => '创服',
  111. 'default' => '0',
  112. 'desc' => '创服',
  113. 'match' => 'is_numeric',
  114. 'search' => 'order',
  115. 'list' => true,
  116. ),
  117. 'cv_num' => array
  118. (
  119. 'type' => 'int-11',
  120. 'name' => '创V',
  121. 'default' => '0',
  122. 'desc' => '创V',
  123. 'match' => 'is_numeric',
  124. 'search' => 'order',
  125. 'list' => true,
  126. ),
  127. 'state' => array
  128. (
  129. 'type' => 'tinyint-1',
  130. 'name' => '数据状态',
  131. 'default' => '1',
  132. 'desc' => '请选择状态',
  133. 'match' => 'is_numeric',
  134. ),
  135. 'cdate' => array
  136. (
  137. 'type' => 'int-11',
  138. 'name' => '发布时间',
  139. 'match' => array('is_numeric', time()),
  140. 'desc' => '',
  141. # 只有insert时才生效
  142. 'insert' => true,
  143. //'search' => 'date',
  144. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  145. ),
  146. ),
  147. 'manage' => array
  148. (
  149. 'insert' => false,
  150. 'edit' => false,
  151. 'delete' => false,
  152. 'num' => false,
  153. 'excel' => $excel,
  154. ),
  155. # request 请求接口定义
  156. 'request' => array
  157. (
  158. 'list' => array
  159. (
  160. # 匹配的正则或函数 选填项
  161. 'option' => array
  162. (
  163. 'start_day' => array('yes-day', '>='),
  164. 'end_day' => array('yes-day', '<='),
  165. 'state' => 1,
  166. ),
  167. 'type' => 'all',
  168. 'order' => array('time' => 'desc', 'cdate' => 'desc'),
  169. 'page' => array(20, 'list'),
  170. 'group' => 'day',//num,city_num,county_num,town_num,ck_num,xk_num
  171. 'col' => '*,min(day) as time, sum(num) as num, sum(city_num) as city_num, sum(county_num) as county_num, sum(town_num) as town_num, sum(ck_num) as ck_num, sum(xk_num) as xk_num,sum(cf_num) as cf_num,sum(cv_num) as cv_num',
  172. ),
  173. 'all' => array
  174. (
  175. # 匹配的正则或函数 选填项
  176. 'option' => array
  177. (
  178. 'start_day' => array('yes-day', '>='),
  179. 'end_day' => array('yes-day', '<='),
  180. 'state' => 1,
  181. ),
  182. 'type' => 'all',
  183. 'order' => array('time' => 'desc', 'cdate' => 'desc'),
  184. 'group' => 'day',//num,city_num,county_num,town_num,ck_num,xk_num
  185. 'col' => '*,min(day) as time, sum(num) as num, sum(city_num) as city_num, sum(county_num) as county_num, sum(town_num) as town_num, sum(ck_num) as ck_num, sum(xk_num) as xk_num',
  186. ),
  187. ),
  188. );
  189. return $config;