Bläddra i källkod

修改数据导出

lvhao 1 dag sedan
förälder
incheckning
43c85d3ebf
1 ändrade filer med 11 tillägg och 8 borttagningar
  1. 11 8
      core/CoreApp/controllers/Whlabel.php

+ 11 - 8
core/CoreApp/controllers/Whlabel.php

@@ -1385,10 +1385,10 @@ class Whlabel extends Start_Controller
 				});
 				$t = array_sum(array_column($tdata, 'jnum'));
 
-				$zdata = array_filter($qbdata, function ($item) {
-					return $item['zd'] != "" && $item['state'] < 1;
-				});
-				$z = array_sum(array_column($zdata, 'jnum'));
+				// $zdata = array_filter($qbdata, function ($item) {
+				// 	return $item['zd'] != "" && $item['state'] < 1;
+				// });
+				// $z = array_sum(array_column($zdata, 'jnum'));
 
 				$zdata = array_filter($qbdata, function ($item) {
 					return $item['zd'] != "" && $item['state'] < 1;
@@ -2270,7 +2270,7 @@ class Whlabel extends Start_Controller
 				$start = ($page - 1) * $perpage;
 			}
 			//取得信息列表
-			$info_list = $this->whlabel->find_pc($where, 'enter,warehouse,sku', 'id,warehouse,shop,sku,title,enter', $order_str, $start, $perpage);
+			$info_list = $this->whlabel->find_pc($where, 'warehouse,sku,enter', 'id,warehouse,shop,sku,title,enter', $order_str, $start, $perpage);
 			foreach ($info_list as $k => $v) {
 				$info_list[$k]['warehouse'] = $wh[$v['warehouse']];
 				if ($v['shop'] == '') {
@@ -2286,7 +2286,7 @@ class Whlabel extends Start_Controller
 				$info_list[$k]['g'] = $g;
 			}
 			//$total = count($this->whlabel->find_pc($where, 'sku,features,warehouse', 'id,warehouse,sku,title,features,number'));
-			$total = count($this->whlabel->find_pc($where, 'enter,warehouse,sku', 'id,warehouse,sku,title,features,number'));
+			$total = count($this->whlabel->find_pc($where, 'warehouse,sku,enter', 'id,warehouse,sku,title,features,number'));
 			$pagenum = ceil($total / $perpage);
 			$over = $total - ($start + $perpage);
 			$rows = array('total' => $total, 'over' => $over, 'pagenum' => $pagenum, 'rows' => ($info_list));
@@ -2626,7 +2626,7 @@ class Whlabel extends Start_Controller
 		foreach ($powertext as $v) {
 			$pid .= " id = " . $v . " or";
 		}
-		$fullorderexcel = $this->fullorderexcel->find_all("type = '100002' and (" . rtrim($pid, 'or') . ")", '*', 'idorder desc'); //导出模板
+		$fullorderexcel = $this->fullorderexcel->find_all("1=1"); //导出模板
 		$this->data['fullorderexcel'] = $fullorderexcel;
 		$orderurl = $this->orderurl->find_all(rtrim($fgshop, 'or'));
 		$this->data['orderurl'] = $orderurl;
@@ -2649,6 +2649,7 @@ class Whlabel extends Start_Controller
 			}
 		} else {
 			echo "请重新登录";
+			die;
 		}
 		$post = $this->input->post(NULL, TRUE);
 		if (isset($post['page'])) {
@@ -3761,7 +3762,9 @@ class Whlabel extends Start_Controller
 			$jtime = $this->input->get('jtime', true);
 			$ktime = strtotime($ktime);
 			$jtime = strtotime($jtime);
-			$where = "1=1";
+			//$where = " 1=1 ";
+			//发现数据表中有20多万条数据是没有sku的,所以这里加上sku判断,避免导出空数据
+			$where = " sku != '' ";
 			$gj = "";
 			$ck = "";
 			if ($category) {