Browse Source

提交信息

lvhao 3 days ago
parent
commit
f7785c0831
1 changed files with 12 additions and 4 deletions
  1. 12 4
      core/CoreApp/controllers/Whlabelfz1.php

+ 12 - 4
core/CoreApp/controllers/Whlabelfz1.php

@@ -49,14 +49,22 @@ class Whlabelfz1 extends Start_Controller
 		if(!empty($post)){
 			$timetk = $this->input->post('timetk',true);
 			$timetj = $this->input->post('timetj',true);
+			$type = $this->input->post('type',true);
 			$timetk = strtotime($timetk);
 			$timetj = strtotime($timetj);
 			$page = $this->input->post('page', true);
 			$perpage = $this->input->post('perpage', true);
-			$where_sql = " scantime >= ".$timetk ." and scantime <= ".$timetj." ";
+			$where_sql = " 1=1 ";
+			if($timetk&&$timetj){
+				$where_sql .= " and scantime >= ".$timetk ." and scantime <= ".$timetj." ";
+
+			}
 			if(!empty($post['orderinfo'])){
 				$where_sql .=" and orderinfo = '".$post['orderinfo']."' ";
 			}
+			if($type){
+				$where_sql .=" and type = ".$type." ";
+			}
 			$list = $this->db->from("whlabel_bh_scan")->select('id,orderinfo,type,jm,pm,sl,scantime')->where($where_sql)->order_by('id desc')->limit($perpage,($page-1)*$perpage)->get()->result_array();
 			$total = $this->db->from("whlabel_bh_scan")->where($where_sql)->count_all_results();
 			$pagenum = ceil($total/$perpage);
@@ -145,8 +153,8 @@ class Whlabelfz1 extends Start_Controller
 			$num = 1;
 		}
 		if($type == 2){
-			if($num > 200){
-				exit(json_encode(['code'=>-1,'msg'=>'扫描数量不能大于200','data'=>[],JSON_UNESCAPED_UNICODE]));
+			if($num > 2000){
+				exit(json_encode(['code'=>-1,'msg'=>'扫描数量不能大于2000','data'=>[],JSON_UNESCAPED_UNICODE]));
 			}
 		}
 		$info = $this->whlabel_bh_scan->find("label ='".$label."'");
@@ -174,7 +182,7 @@ class Whlabelfz1 extends Start_Controller
 		}
 		$arr = [
 			'orderinfo'=>(string)$orderinfo,
-			'type'=>2,
+			'type'=>1,
 			'label'=>(string)$label,
 			'features'=>(string)$info['features'],
 			'fid'=>$info['id'],