order_stat.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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,agent_cash,no_num,no_cash',
  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' => 'decimal-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. 'agent_cash' => array
  79. (
  80. 'type' => 'decimal-11,2',
  81. 'name' => '确认代理费',
  82. 'default' => '0',
  83. 'desc' => '确认代理费',
  84. 'match' => 'is_numeric',
  85. 'search' => 'order',
  86. 'list' => true,
  87. // 'round({cash}, 2)',
  88. ),
  89. 'daili_num' => array
  90. (
  91. 'type' => 'int-11',
  92. 'name' => '新增代理商数量',
  93. 'default' => '0',
  94. 'desc' => '新增代理商数量',
  95. 'match' => 'is_numeric',
  96. 'search' => 'order',
  97. 'list' => true,
  98. ),
  99. 'no_num' => array
  100. (
  101. 'type' => 'int-11',
  102. 'name' => '未确认订单数',
  103. 'default' => '0',
  104. 'desc' => '未确认订单数',
  105. 'match' => 'is_numeric',
  106. 'search' => 'order',
  107. 'list' => true,
  108. ),
  109. 'no_cash' => array
  110. (
  111. 'type' => 'decimal-11,2',
  112. 'name' => '未确认订单额度',
  113. 'default' => '0',
  114. 'desc' => '未确认订单额度',
  115. 'match' => 'is_numeric',
  116. 'search' => 'order',
  117. 'list' => true,
  118. // 'round({cash}, 2)',
  119. ),
  120. 'state' => array
  121. (
  122. 'type' => 'tinyint-1',
  123. 'name' => '数据状态',
  124. 'default' => '1',
  125. 'desc' => '请选择状态',
  126. 'match' => 'is_numeric',
  127. ),
  128. 'cdate' => array
  129. (
  130. 'type' => 'int-11',
  131. 'name' => '发布时间',
  132. 'match' => array('is_numeric', time()),
  133. 'desc' => '',
  134. # 只有insert时才生效
  135. 'insert' => true,
  136. //'search' => 'date',
  137. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  138. ),
  139. ),
  140. 'manage' => array
  141. (
  142. 'insert' => false,
  143. 'edit' => false,
  144. 'delete' => false,
  145. 'excel' => $excel,
  146. ),
  147. # request 请求接口定义
  148. 'request' => array
  149. (
  150. 'list' => array
  151. (
  152. # 匹配的正则或函数 选填项
  153. 'option' => array
  154. (
  155. 'start_day' => array('yes-day', '>='),
  156. 'end_day' => array('yes-day', '<='),
  157. 'state' => 1,
  158. ),
  159. 'type' => 'all',
  160. 'order' => array('time' => 'desc', 'cdate' => 'desc'),
  161. 'page' => array(20, 'list'),
  162. 'group' => 'day',//num,yes_num,cash,daili_num
  163. '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, sum(agent_cash) as agent_cash, sum(no_cash) as no_cash, sum(no_num) as no_num',
  164. ),
  165. 'all' => array
  166. (
  167. # 匹配的正则或函数 选填项
  168. 'option' => array
  169. (
  170. 'start_day' => array('yes-day', '>='),
  171. 'end_day' => array('yes-day', '<='),
  172. 'state' => 1,
  173. ),
  174. 'type' => 'all',
  175. 'order' => array('time' => 'desc', 'cdate' => 'desc'),
  176. 'group' => 'day',//num,yes_num,cash,daili_num
  177. '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, sum(agent_cash) as agent_cash, sum(no_cash) as no_cash, sum(no_num) as no_num',
  178. ),
  179. ),
  180. );
  181. return $config;