ShuanghongS vor 1 Monat
Ursprung
Commit
63934cf1c7
1 geänderte Dateien mit 14 neuen und 8 gelöschten Zeilen
  1. 14 8
      service/report.class.php

+ 14 - 8
service/report.class.php

@@ -281,7 +281,12 @@ class report {
                 $_data_type = common::check_input($_tempFieldsList['dataType']);
                 $_value_type =  $_field_type == "System" ? "" : (empty($_tempFieldsList['value']) ? "Blank" :"Fixed Value");
                 $_fixed_value = common::check_input($_tempFieldsList['value']);
-                $_is_filter_enabled = $_tempFieldsList['isFilter'];
+                //这两个不能配置查询和过滤
+                if($_field_group_name == 'Container info' || $_field_group_name == 'Milestone' ){
+                    $_is_filter_enabled = "false";
+                }else{
+                    $_is_filter_enabled = $_tempFieldsList['isFilter'];
+                }
                 $_is_sort_enabled = $_tempFieldsList['isSort'];
                 $sql .=  "INSERT INTO public.kln_report_field_config(
                             template_serial_no, field_id, field_level, field_type, field_db, field_group_name,
@@ -376,6 +381,7 @@ class report {
                     $filtersList[] = array(
                         "label"=>$filed['field_display_name_user'],
                         "field"=>$field_display_name,
+                        "field_real"=>$filed['field_display_name'],
                         "type"=>$type,
                         "data_type"=>$filed['data_type'],
                         "value"=>[],"options"=>[]);
@@ -894,27 +900,27 @@ class report {
                     $_post_field = trim($_post_field, '_');
 
                     if ($fiter['data_type'] == "string"){
-                        $vvSearchKLN .= " and \"".$fiter['field']."\" ilike '%". common::check_input($_POST [$_post_field])."%'"; 
+                        $vvSearchKLN .= " and \"".$fiter['field_real']."\" ilike '%". common::check_input($_POST [$_post_field])."%'"; 
                     } elseif ($fiter['data_type'] == "number"){
                         $temp_arr = $_POST [$_post_field];
                         if(!empty($temp_arr[0])){
-                            $vvSearchKLN .= " and \"".$fiter['field']."\"::integer >= '". common::check_input($temp_arr[0])."'"; 
+                            $vvSearchKLN .= " and \"".$fiter['field_real']."\"::integer >= '". common::check_input($temp_arr[0])."'"; 
                         }
                         if(!empty($temp_arr[1])){
-                            $vvSearchKLN .= " and \"".$fiter['field']."\"::integer <= '". common::check_input($temp_arr[1])."'"; 
+                            $vvSearchKLN .= " and \"".$fiter['field_real']."\"::integer <= '". common::check_input($temp_arr[1])."'"; 
                         }  
                     } elseif ($fiter['data_type'] == "date"){
                         $temp_arr = $_POST [$_post_field];
                         //先判断日期字符串是否为空,这里则有做 是因为sql 整合了柜子315时间,和 milestone的时间, 只能text转date
                         if(!empty($temp_arr[0])){
                             $date_from = common::check_input(common::usDate2sqlDate($temp_arr[0]) . ' 00:00:00');
-                            $vvSearchKLN .= " and COALESCE(\"".$fiter['field']."\",''::text)<> ''::text ";  
-                            $vvSearchKLN .= " and to_timestamp(\"".$fiter['field']."\", 'MM/DD/YYYY HH24:MI:SS') >= '". $date_from."'"; 
+                            $vvSearchKLN .= " and COALESCE(\"".$fiter['field_real']."\",''::text)<> ''::text ";  
+                            $vvSearchKLN .= " and to_timestamp(\"".$fiter['field_real']."\", 'MM/DD/YYYY HH24:MI:SS') >= '". $date_from."'"; 
                         }
                         if(!empty($temp_arr[1])){
                             $date_to = common::check_input(common::usDate2sqlDate($temp_arr[1]) . ' 23:59:59');
-                            $vvSearchKLN .= " and COALESCE(\"".$fiter['field']."\",''::text)<> ''::text ";  
-                            $vvSearchKLN .= " and to_timestamp(\"".$fiter['field']."\", 'MM/DD/YYYY HH24:MI:SS') <= '". $date_to."'"; 
+                            $vvSearchKLN .= " and COALESCE(\"".$fiter['field_real']."\",''::text)<> ''::text ";  
+                            $vvSearchKLN .= " and to_timestamp(\"".$fiter['field_real']."\", 'MM/DD/YYYY HH24:MI:SS') <= '". $date_to."'"; 
                         }
                     }
                 }