role_stat.php 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <?php
  2. if (Dever::load('manage/auth')->checkFunc('bill.role_stat', 'out_bill_role', '导出数据')) {
  3. $excel = true;
  4. }else{
  5. $excel = false;
  6. }
  7. $role = function()
  8. {
  9. $array = array();
  10. $data = Dever::load('setting/lib/manage.role');
  11. if($data)
  12. {
  13. $array += $data;
  14. }
  15. return $array;
  16. };
  17. $config = array
  18. (
  19. # 表名
  20. 'name' => 'role_stat',
  21. # 显示给用户看的名称
  22. 'lang' => '角色统计',
  23. 'order' => -10,
  24. # 数据结构 不同的字段放这里
  25. 'struct' => array
  26. (
  27. 'id' => array
  28. (
  29. 'type' => 'int-11',
  30. 'name' => 'ID',
  31. 'default' => '',
  32. 'desc' => '',
  33. 'match' => 'is_numeric',
  34. //'list' => true,
  35. ),
  36. 'day' => array
  37. (
  38. 'type' => 'int-11',
  39. 'name' => '日期',
  40. 'default' => '',
  41. 'match' => 'is_numeric',
  42. 'desc' => '',
  43. 'search' => 'day',
  44. 'search_button' => array
  45. (
  46. 'sum' => 'num,cash,touru,shouru',
  47. 'option' => array(
  48. 'day' => '按天',
  49. 'week' => '按周',
  50. 'month' => '按月',
  51. ),
  52. 'group' => '',
  53. ),
  54. 'order' => 'desc',
  55. 'list' => 'Dever::showDay("{day}")',
  56. ),
  57. 'role' => array
  58. (
  59. 'type' => 'int-11',
  60. 'name' => '代理角色',
  61. 'default' => '',
  62. 'desc' => '代理角色',
  63. 'match' => 'is_numeric',
  64. 'search' => 'select',
  65. 'update' => 'select',
  66. 'option' => $role,
  67. 'list' => true,
  68. ),
  69. 'num' => array
  70. (
  71. 'type' => 'int-11',
  72. 'name' => '数量',
  73. 'default' => '0',
  74. 'desc' => '数量',
  75. 'match' => 'is_numeric',
  76. 'search' => 'order',
  77. 'list' => true,
  78. ),
  79. 'cash' => array
  80. (
  81. 'type' => 'decimal-11,2',
  82. 'name' => '金额',
  83. 'default' => '0',
  84. 'desc' => '金额',
  85. 'match' => 'is_numeric',
  86. 'search' => 'order',
  87. 'list' => true,
  88. ),
  89. 'touru' => array
  90. (
  91. 'type' => 'decimal-11,2',
  92. 'name' => '投入成本',
  93. 'default' => '0',
  94. 'desc' => '投入成本',
  95. 'match' => 'is_numeric',
  96. 'search' => 'order',
  97. 'list' => true,
  98. ),
  99. 'shouru' => array
  100. (
  101. 'type' => 'decimal-11,2',
  102. 'name' => '角色收入',
  103. 'default' => '0',
  104. 'desc' => '角色收入',
  105. 'match' => 'is_numeric',
  106. 'search' => 'order',
  107. 'list' => true,
  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,city_num,county_num,town_num,ck_num,xk_num
  153. 'col' => '*,min(day) as time, sum(num) as num, sum(cash) as cash, sum(touru) as touru, sum(shouru) as shouru',
  154. ),
  155. 'all' => array
  156. (
  157. # 匹配的正则或函数 选填项
  158. 'option' => array
  159. (
  160. 'start_day' => array('yes-day', '>='),
  161. 'end_day' => array('yes-day', '<='),
  162. 'state' => 1,
  163. ),
  164. 'type' => 'all',
  165. 'order' => array('time' => 'desc', 'cdate' => 'desc'),
  166. 'group' => 'day',//num,city_num,county_num,town_num,ck_num,xk_num
  167. 'col' => '*,min(day) as time, sum(num) as num, sum(cash) as cash, sum(touru) as touru, sum(shouru) as shouru',
  168. ),
  169. ),
  170. );
  171. return $config;