瀏覽代碼

提交统计概览

walkor 11 年之前
父節點
當前提交
b2a9cd92fb

+ 6 - 1
applications/Statistics/Modules/main.php

@@ -43,12 +43,17 @@ function main($module, $interface, $date, $offset)
     // 返回码分布
     $code_pie_data = '';
     $code_pie_array = array(); 
+    unset($code_map[0]);
+    if(empty($code_map))
+    {
+        $code_map[0] = $total_count > 0 ? $total_count : 1;
+    }
     if(is_array($code_map))
     {
         $total_item_count = array_sum($code_map);
         foreach($code_map as $code=>$count)
         {
-            $code_pie_array[] = "[\"$code\", ".round($count*100/$total_item_count, 4)."]";
+            $code_pie_array[] = "[\"$code:{$count}个\", ".round($count*100/$total_item_count, 4)."]";
         }
         $code_pie_data = implode(',', $code_pie_array);
     }

+ 4 - 8
applications/Statistics/Views/main.tpl.php

@@ -36,23 +36,19 @@
 				</div>
 		    </div>
 			<div class="row clearfix">
-				<div class="col-md-6 column" id="suc-pie">
+				<div class="col-md-6 column height-400" id="suc-pie">
 				</div>
-				<div class="col-md-6 column" id="code-pie">
+				<div class="col-md-6 column height-400" id="code-pie">
 				</div>
 			</div>
 			<div class="row clearfix">
-				<div class="col-md-12 column" id="req-container" >
+				<div class="col-md-12 column height-400" id="req-container" >
 				</div>
 			</div>
 			<div class="row clearfix">
-				<div class="col-md-12 column" id="time-container" >
+				<div class="col-md-12 column height-400" id="time-container" >
 				</div>
 			</div>
-			<div class="text-center">
-			<button class="btn btn-primary" type="button">分别统计</button>
-			<button class="btn btn-primary" type="button">汇总统计</button>
-			</div>
 			<table class="table table-hover table-condensed table-bordered">
 				<thead>
 					<tr>

+ 3 - 0
applications/Statistics/Web/css/style.css

@@ -1,4 +1,7 @@
 body {margin: 10px 0px}
 .nav {
     margin-bottom: 10px;
+}
+.height-400{
+	height:400px
 }