info_stat.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <?php
  2. $cate = function()
  3. {
  4. $array = array();
  5. $data = Dever::db('work/q_cate')->state();
  6. if($data)
  7. {
  8. $array += $data;
  9. }
  10. return $array;
  11. };
  12. return array
  13. (
  14. # 表名
  15. 'name' => 'info_stat',
  16. # 显示给用户看的名称
  17. 'lang' => '工单统计',
  18. 'order' => -100,
  19. 'menu' => true,
  20. # 数据结构
  21. 'struct' => array
  22. (
  23. 'id' => array
  24. (
  25. 'type' => 'int-11',
  26. 'name' => 'ID',
  27. 'default' => '',
  28. 'desc' => '',
  29. 'match' => 'is_numeric',
  30. 'search' => 'order',
  31. //'list' => true,
  32. ),
  33. 'cate' => array
  34. (
  35. 'type' => 'int-11',
  36. 'name' => '问题分类',
  37. 'default' => '0',
  38. 'desc' => '问题分类',
  39. 'match' => 'option',
  40. 'option' => $cate,
  41. 'search' => 'select',
  42. 'update' => 'text',
  43. // 'list' => true,
  44. ),
  45. 'day' => array
  46. (
  47. 'type' => 'int-11',
  48. 'name' => '日期',
  49. 'default' => '',
  50. 'match' => 'is_numeric',
  51. 'desc' => '',
  52. 'search' => 'day',
  53. 'search_button' => array
  54. (
  55. 'sum' => 'question,super,urgent,yb,pt',
  56. 'option' => array(
  57. 'day' => '按天',
  58. 'week' => '按周',
  59. 'month' => '按月',
  60. ),
  61. // 'group' => 'cate',
  62. ),
  63. 'order' => 'desc',
  64. 'list' => 'Dever::showDay("{day}")',
  65. ),
  66. 'question' => array
  67. (
  68. 'type' => 'int-11',
  69. 'name' => '工单总量',
  70. 'default' => '0',
  71. 'desc' => '工单总量',
  72. 'match' => 'option',
  73. 'update' => 'text',
  74. 'list' => true,
  75. ),
  76. 'super' => array
  77. (
  78. 'type' => 'int-11',
  79. 'name' => '超级紧急',
  80. 'default' => '0',
  81. 'desc' => '超级紧急',
  82. 'match' => 'option',
  83. 'update' => 'text',
  84. 'list' => true,
  85. ),
  86. 'urgent' => array
  87. (
  88. 'type' => 'int-11',
  89. 'name' => '紧急',
  90. 'default' => '0',
  91. 'desc' => '紧急',
  92. 'match' => 'option',
  93. 'update' => 'text',
  94. 'list' => true,
  95. ),
  96. 'yb' => array
  97. (
  98. 'type' => 'int-11',
  99. 'name' => '一般',
  100. 'default' => '0',
  101. 'desc' => '一般',
  102. 'match' => 'option',
  103. 'update' => 'text',
  104. 'list' => true,
  105. ),
  106. 'pt' => array
  107. (
  108. 'type' => 'int-11',
  109. 'name' => '普通',
  110. 'default' => '0',
  111. 'desc' => '普通',
  112. 'match' => 'option',
  113. 'update' => 'text',
  114. 'list' => true,
  115. ),
  116. 'state' => array
  117. (
  118. 'type' => 'tinyint-1',
  119. 'name' => '状态',
  120. 'default' => '1',
  121. 'desc' => '请选择状态',
  122. 'match' => 'is_numeric',
  123. ),
  124. 'cdate' => array
  125. (
  126. 'type' => 'int-11',
  127. 'name' => '生成时间',
  128. 'match' => array('is_numeric', time()),
  129. 'desc' => '',
  130. # 只有insert时才生效
  131. 'insert' => true,
  132. //'search' => 'date',
  133. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  134. //'list' => 'Dever::load("service/lib/manage.showOrderTime", "{id}")',
  135. ),
  136. ),
  137. 'manage' => array
  138. (
  139. 'delete' => false,
  140. 'edit' => false,
  141. 'insert' => false,
  142. 'chart' => array
  143. (
  144. 'x' => 'day',
  145. 'data' => array('question','super','urgent','yb','pt'),
  146. ),
  147. 'data' => array
  148. (
  149. array('工单总量', function() {return Dever::db('work/info')->total(array('state'=>1));}),
  150. array('今日新增', function() {list($start, $end) = Dever::day(); return Dever::db('work/info')->total(array('start' => $start, 'end' => $end, 'state'=>1));}),
  151. array('本月新增', function() {list($start, $end) = Dever::month();return Dever::db('work/info')->total(array('start' => $start, 'end' => $end, 'state'=>1));}),
  152. array('待处理', function() {return Dever::db('work/info')->total(array('status'=>1, 'state'=>1));}),
  153. array('处理中', function() {return Dever::db('work/info')->total(array('status' => 2,'state'=>1));}),
  154. array('完成关闭', function() {return Dever::db('work/info')->total(array('status' => 3, 'state'=>1));}),
  155. array('取消关闭', function() {return Dever::db('work/info')->total(array('status' => 4,'state'=>1));}),
  156. ),
  157. ),
  158. 'request' => array
  159. (
  160. 'list' => array
  161. (
  162. # 匹配的正则或函数 选填项
  163. 'option' => array
  164. (
  165. 'cate' => 'yes',
  166. 'start' => array('yes-day', '>='),
  167. 'end' => array('yes-day', '<='),
  168. 'state' => 1,
  169. ),
  170. 'type' => 'all',
  171. 'order' => array('day' => 'desc', 'cdate' => 'desc'),
  172. 'page' => array(20, 'list'),
  173. 'group' => 'day',
  174. 'col' => '*,sum(question) as question, sum(super) as super, sum(urgent) as urgent, sum(yb) as yb, sum(pt) as pt',
  175. ),
  176. ),
  177. );