Browse Source

Dashboard search

ShuanghongS 1 year ago
parent
commit
e88a70a8e9
2 changed files with 16 additions and 17 deletions
  1. 15 16
      main_new_version.php
  2. 1 1
      utils/common.class.php

+ 15 - 16
main_new_version.php

@@ -81,8 +81,8 @@ switch ($action) {
             $edate = "'$edate'";
         }
         //Demo测试数据 日期全为空 :前端是由日期过来来的
-        //$edate = "null";
-        //$bdate = "null";
+        // $edate = "null";
+        // $bdate = "null";
 
         $sqlWhere = ' and ' . common::searchExtendHandNew("ocean", $_SESSION["ONLINE_USER"]);
         $sqlWhere = common::check_input($sqlWhere);
@@ -112,8 +112,8 @@ switch ($action) {
             }
             if($mode == 'Air'){
                 //暂时查询空数据 
-                $sqlWhere .= " and 1<>1 ";
-                $Airlist = common::excuteListSql("select * from public.online_order_status_date('$type'::text, 'eta'::text, 'etd'::text, $bdate, $edate, '$sqlWhere'::text, '$container_type'::text) "
+                $sqlWhere_air = $sqlWhere ." and 1<>1 ";
+                $Airlist = common::excuteListSql("select * from public.online_order_status_date('$type'::text, 'eta'::text, 'etd'::text, $bdate, $edate, '$sqlWhere_air'::text, '$container_type'::text) "
                     . "r (c bigint, e integer, b integer, d text)");
                 //拼接数据     
                 if(empty($list)){
@@ -125,8 +125,8 @@ switch ($action) {
                 }       
             }
             if($mode == 'Road'){
-                $sqlWhere .= " and 1<>1 ";
-                $roadlist = common::excuteListSql("select * from public.online_order_status_date('$type'::text, 'eta'::text, 'etd'::text, $bdate, $edate, '$sqlWhere'::text, '$container_type'::text) "
+                $sqlWhere_road = $sqlWhere ." and 1<>1 ";
+                $roadlist = common::excuteListSql("select * from public.online_order_status_date('$type'::text, 'eta'::text, 'etd'::text, $bdate, $edate, '$sqlWhere_road'::text, '$container_type'::text) "
                     . "r (c bigint, e integer, b integer, d text)");  
                 //拼接数据     
                 if(empty($list)){
@@ -188,7 +188,6 @@ switch ($action) {
             $edate = $_REQUEST["date_end"];
             $edate = "'$edate'";
         }
-    
         $sqlWhere = ' and ' . common::searchExtendHandNew("ocean", $_SESSION["ONLINE_USER"]);
         $sqlWhere = common::check_input($sqlWhere);
         $sqlWhere = " " . $sqlWhere;
@@ -216,8 +215,8 @@ switch ($action) {
             }
             if($mode == 'Air'){
                 //暂时查询空数据 
-                $sqlWhere .= " and 1<>1 ";
-                $Airlist = common::excuteListSql("select * from public.online_order_status_date_new_r1_r2('$type'::text, 'eta'::text, 'etd'::text, $bdate, $edate, '$sqlWhere'::text, '$container_type'::text,'$date_type'::text) "
+                $sqlWhere_air = $sqlWhere ." and 1<>1 ";
+                $Airlist = common::excuteListSql("select * from public.online_order_status_date_new_r1_r2('$type'::text, 'eta'::text, 'etd'::text, $bdate, $edate, '$sqlWhere_air'::text, '$container_type'::text,'$date_type'::text) "
                     . "r (c bigint, e integer, b integer, d text)");
                 //拼接数据     
                 if(empty($list)){
@@ -229,8 +228,8 @@ switch ($action) {
                 }       
             }
             if($mode == 'Road'){
-                $sqlWhere .= " and 1<>1 ";
-                $roadlist = common::excuteListSql("select * from public.online_order_status_date_new_r1_r2('$type'::text, 'eta'::text, 'etd'::text, $bdate, $edate, '$sqlWhere'::text, '$container_type'::text,'$date_type'::text) "
+                $sqlWhere_road = $sqlWhere ." and 1<>1 ";
+                $roadlist = common::excuteListSql("select * from public.online_order_status_date_new_r1_r2('$type'::text, 'eta'::text, 'etd'::text, $bdate, $edate, '$sqlWhere_road'::text, '$container_type'::text,'$date_type'::text) "
                     . "r (c bigint, e integer, b integer, d text)");  
                 //拼接数据     
                 if(empty($list)){
@@ -309,9 +308,9 @@ switch ($action) {
                 }     
             }
             if($mode == 'Air'){
-                //暂时查询空数据 
-                $sqlWhere .= " and 1<>1 ";
-                $Airlist = common::excuteListSql("select * from public.online_order_status_date_kpi_new('$type'::text,'$sqlWhere'::text) "
+                //暂时查询空数据
+                $sqlWhere_air = $sqlWhere ." and 1<>1 ";
+                $Airlist = common::excuteListSql("select * from public.online_order_status_date_kpi_new('$type'::text,'$sqlWhere_air'::text) "
                     . "r (c bigint, d text)");
                 //拼接数据     
                 if(empty($list)){
@@ -323,8 +322,8 @@ switch ($action) {
                 }       
             }
             if($mode == 'Road'){
-                $sqlWhere .= " and 1<>1 ";
-                $roadlist = common::excuteListSql("select * from public.online_order_status_date_kpi_new('$type'::text,'$sqlWhere'::text) "
+                $sqlWhere_road = $sqlWhere ." and 1<>1 ";
+                $roadlist = common::excuteListSql("select * from public.online_order_status_date_kpi_new('$type'::text,'$sqlWhere_road'::text) "
                  . "r (c bigint, d text)");  
                 //拼接数据     
                 if(empty($list)){

+ 1 - 1
utils/common.class.php

@@ -1345,7 +1345,7 @@ class common {
             $max = 0;
             $data = array();
             foreach($co2e as $val){
-                $data[] = empty($val['catnum'])? 0 : number_format($val['catnum'], 4);
+                $data[] = empty($val['catnum'])? 0 : floatval(number_format($val['catnum'], 4));
                 $total = $total + $val['catnum'];
                 $max = $max < $val['catnum'] ? $val['catnum'] : $max;
             }