order_stat.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <?php
  2. $config = array
  3. (
  4. # 表名
  5. 'name' => 'order_stat',
  6. # 显示给用户看的名称
  7. 'lang' => '营业额统计',
  8. 'order' => -10,
  9. # 数据结构 不同的字段放这里
  10. 'struct' => array
  11. (
  12. 'id' => array
  13. (
  14. 'type' => 'int-11',
  15. 'name' => 'ID',
  16. 'default' => '',
  17. 'desc' => '',
  18. 'match' => 'is_numeric',
  19. //'list' => true,
  20. ),
  21. 'day' => array
  22. (
  23. 'type' => 'int-11',
  24. 'name' => '日期',
  25. 'default' => '',
  26. 'match' => 'is_numeric',
  27. 'desc' => '',
  28. 'search' => 'day',
  29. 'search_button' => array
  30. (
  31. 'sum' => 'num,yes_num,cash,daili_num',
  32. 'option' => array(
  33. 'day' => '按天',
  34. 'week' => '按周',
  35. 'month' => '按月',
  36. ),
  37. 'group' => '',
  38. ),
  39. 'order' => 'desc',
  40. 'list' => 'Dever::showDay("{day}")',
  41. ),
  42. 'num' => array
  43. (
  44. 'type' => 'int-11',
  45. 'name' => '订单数',
  46. 'default' => '0',
  47. 'desc' => '订单数',
  48. 'match' => 'is_numeric',
  49. 'search' => 'order',
  50. 'list' => true,
  51. ),
  52. 'yes_num' => array
  53. (
  54. 'type' => 'int-11',
  55. 'name' => '确认订单数',
  56. 'default' => '0',
  57. 'desc' => '确认订单数',
  58. 'match' => 'is_numeric',
  59. 'search' => 'order',
  60. 'list' => true,
  61. ),
  62. 'cash' => array
  63. (
  64. 'type' => 'varchar-100',
  65. 'name' => '确认订单额度',
  66. 'default' => '0',
  67. 'desc' => '确认订单额度',
  68. 'match' => 'is_string',
  69. 'search' => 'order',
  70. 'list' => 'round({cash}, 2)',
  71. ),
  72. 'daili_num' => array
  73. (
  74. 'type' => 'int-11',
  75. 'name' => '新增代理商数量',
  76. 'default' => '0',
  77. 'desc' => '新增代理商数量',
  78. 'match' => 'is_numeric',
  79. 'search' => 'order',
  80. 'list' => true,
  81. ),
  82. 'state' => array
  83. (
  84. 'type' => 'tinyint-1',
  85. 'name' => '数据状态',
  86. 'default' => '1',
  87. 'desc' => '请选择状态',
  88. 'match' => 'is_numeric',
  89. ),
  90. 'cdate' => array
  91. (
  92. 'type' => 'int-11',
  93. 'name' => '发布时间',
  94. 'match' => array('is_numeric', time()),
  95. 'desc' => '',
  96. # 只有insert时才生效
  97. 'insert' => true,
  98. //'search' => 'date',
  99. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  100. ),
  101. ),
  102. 'manage' => array
  103. (
  104. 'insert' => false,
  105. 'edit' => false,
  106. 'delete' => false,
  107. 'num' => false,
  108. 'excel' => true,
  109. ),
  110. # request 请求接口定义
  111. 'request' => array
  112. (
  113. 'list' => array
  114. (
  115. # 匹配的正则或函数 选填项
  116. 'option' => array
  117. (
  118. 'start_day' => array('yes-day', '>='),
  119. 'end_day' => array('yes-day', '<='),
  120. 'state' => 1,
  121. ),
  122. 'type' => 'all',
  123. 'order' => array('time' => 'desc', 'cdate' => 'desc'),
  124. 'page' => array(20, 'list'),
  125. 'group' => 'day',//num,yes_num,cash,daili_num
  126. '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',
  127. ),
  128. ),
  129. );
  130. return $config;