order_stat.php 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <?php
  2. if (Dever::load('manage/auth')->checkFunc('bill.order_stat', 'edit1', '导出数据')) {
  3. $excel = true;
  4. }else{
  5. $excel = false;
  6. }
  7. $config = array
  8. (
  9. # 表名
  10. 'name' => 'order_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,yes_num,cash,daili_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. 'yes_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. 'cash' => array
  68. (
  69. 'type' => 'float-11,2',
  70. 'name' => '确认订单额度',
  71. 'default' => '0',
  72. 'desc' => '确认订单额度',
  73. 'match' => 'is_numeric',
  74. 'search' => 'order',
  75. 'list' => true,
  76. // 'round({cash}, 2)',
  77. ),
  78. 'daili_num' => array
  79. (
  80. 'type' => 'int-11',
  81. 'name' => '新增代理商数量',
  82. 'default' => '0',
  83. 'desc' => '新增代理商数量',
  84. 'match' => 'is_numeric',
  85. 'search' => 'order',
  86. 'list' => true,
  87. ),
  88. 'no_num' => array
  89. (
  90. 'type' => 'int-11',
  91. 'name' => '未确认订单数',
  92. 'default' => '0',
  93. 'desc' => '未确认订单数',
  94. 'match' => 'is_numeric',
  95. 'search' => 'order',
  96. 'list' => true,
  97. ),
  98. 'no_cash' => array
  99. (
  100. 'type' => 'float-11,2',
  101. 'name' => '未确认订单额度',
  102. 'default' => '0',
  103. 'desc' => '未确认订单额度',
  104. 'match' => 'is_numeric',
  105. 'search' => 'order',
  106. 'list' => true,
  107. // 'round({cash}, 2)',
  108. ),
  109. 'state' => array
  110. (
  111. 'type' => 'tinyint-1',
  112. 'name' => '数据状态',
  113. 'default' => '1',
  114. 'desc' => '请选择状态',
  115. 'match' => 'is_numeric',
  116. ),
  117. 'cdate' => array
  118. (
  119. 'type' => 'int-11',
  120. 'name' => '发布时间',
  121. 'match' => array('is_numeric', time()),
  122. 'desc' => '',
  123. # 只有insert时才生效
  124. 'insert' => true,
  125. //'search' => 'date',
  126. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  127. ),
  128. ),
  129. 'manage' => array
  130. (
  131. 'insert' => false,
  132. 'edit' => false,
  133. 'delete' => false,
  134. 'num' => false,
  135. 'excel' => $excel,
  136. ),
  137. # request 请求接口定义
  138. 'request' => array
  139. (
  140. 'list' => array
  141. (
  142. # 匹配的正则或函数 选填项
  143. 'option' => array
  144. (
  145. 'start_day' => array('yes-day', '>='),
  146. 'end_day' => array('yes-day', '<='),
  147. 'state' => 1,
  148. ),
  149. 'type' => 'all',
  150. 'order' => array('time' => 'desc', 'cdate' => 'desc'),
  151. 'page' => array(20, 'list'),
  152. 'group' => 'day',//num,yes_num,cash,daili_num
  153. 'col' => '*,min(day) as time, sum(yes_num) as yes_num, sum(num) as num, sum(cash) as cash, sum(daili_num) as daili_num',
  154. ),
  155. ),
  156. );
  157. return $config;