lvhao пре 6 месеци
родитељ
комит
135a2b1863
1 измењених фајлова са 28 додато и 23 уклоњено
  1. 28 23
      core/CoreApp/controllers/Transfer.php

+ 28 - 23
core/CoreApp/controllers/Transfer.php

@@ -2208,9 +2208,9 @@ class Transfer extends Start_Controller {
 			$timetk = strtotime($timetk);
 			$timetj = strtotime($timetj);
 
-			$transfer_list = $this->transfer->find_all('id not in (8,9,11,12,15,16)');
-			$t = $transfer_list = array_column($transfer_list, 'title', 'id');
-			$transfer_ids = array_keys($t);
+			// $transfer_list = $this->transfer->find_all('id not in (8,9,11,12,15,16)');
+			// $t = $transfer_list = array_column($transfer_list, 'title', 'id');
+			// $transfer_ids = array_keys($t);
             if(empty($page))
 		    {
                 $start = 0;
@@ -2220,29 +2220,34 @@ class Transfer extends Start_Controller {
 		    {
                 $start = ($page - 1)*$perpage;
             }
-			$cr  = "time > '$timetk' and time < '$timetj'";
-			if($transfer)
-			{
-				$cr  .= " and lx = '".$transfer."' ";
-			}else{
-				$cr  .= " and lx in (".implode(",",$transfer_ids).") ";
-			}
-				$cr  .= " and is_over = 0 ";
-			$info_list_cr = $this->systemtransfer_cr->find_all($cr);
-			$fid = [];
-			foreach ($info_list_cr as $v)
-			{
-				$fid[] = $v['fid']; 
+			$where  = "time > '$timetk' and time < '$timetj'";
+			$where .= " and rk not like %11| ";
+			if(!empty($transfer)){
+				$where .= " and rk like %'".$transfer."'%  ";
 			}
 			
-			if(empty($fid)){
-				$rows = array('total'=>0,'over'=>0,'pagenum'=>0,'rows'=>([]));
-				echo json_encode($rows);exit;
-			}
-			$fid = array_unique($fid);
+			// if($transfer)
+			// {
+			// 	$cr  .= " and lx = '".$transfer."' ";
+			// }else{
+			// 	$cr  .= " and lx in (".implode(",",$transfer_ids).") ";
+			// }
+			// 	$cr  .= " and is_over = 0 ";
+			// $info_list_cr = $this->systemtransfer_cr->find_all($cr);
+			// $fid = [];
+			// foreach ($info_list_cr as $v)
+			// {
+			// 	$fid[] = $v['fid']; 
+			// }
+			
+			// if(empty($fid)){
+			// 	$rows = array('total'=>0,'over'=>0,'pagenum'=>0,'rows'=>([]));
+			// 	echo json_encode($rows);exit;
+			// }
+			// $fid = array_unique($fid);
 			$order_str = "id desc";
             //取得信息列表
-            $info_list = $this->systemtransfer->find_all("id in (".implode(",",$fid).")",'id,number,is_jiaji,pm,shipremarks,printtime,time,ctime12',$order_str,$start,$perpage);
+            $info_list = $this->systemtransfer->find_all($where,'id,number,is_jiaji,pm,shipremarks,printtime,time,ctime12',$order_str,$start,$perpage);
 			$transfer = $this->transfer->find_all();
 			$t = array();
 			foreach ($transfer as $v)
@@ -2295,7 +2300,7 @@ class Transfer extends Start_Controller {
 				unset($info_list[$key]['ctime12']);
             }
 			
-		    $total = $this->systemtransfer->find_count("id in (".implode(",",$fid).")");
+		    $total = $this->systemtransfer->find_count($where);
 		    $pagenum = ceil($total/$perpage);
 		    $over = $total-($start+$perpage);
 		    $rows = array('total'=>$total,'over'=>$over,'pagenum'=>$pagenum,'rows'=>($info_list));