Browse Source

添加进销存的导出含有重量

lvhao 4 tháng trước cách đây
mục cha
commit
5ceaf113ee
1 tập tin đã thay đổi với 76 bổ sung47 xóa
  1. 76 47
      core/CoreApp/controllers/Whlabel.php

+ 76 - 47
core/CoreApp/controllers/Whlabel.php

@@ -3862,55 +3862,83 @@ class Whlabel extends Start_Controller {
 				$rows[$key]['q'] = $q;
 				$rows[$key]['z'] = $z;
 				
-				$features = str_replace(array('-163-','-164-','-165-','-166-'),'-',$value['features']);
-			    $features = explode('-',trim($features,'-'));
-				$rows[$key]['dbcontent'] = $typeclass[$features[0]]['title'];
-				$pm = $classid;
-				$jm = $classid;
-				foreach($features as $k=>$v)
-				{
-					if(isset($typeclass[$v]) && isset($bmpx[$typeclass[$v]['classid']]))
-					{
-						if($typeclass[$v]['bm'] != '')
-						{
-						    $bmpx[$typeclass[$v]['classid']] = $typeclass[$v]['bm'];
-						}
-					}
-					if($v != 0)
-					{
-						if(!isset($typeclass[$v]))
-					    {
-							continue;
-					    }
-					    		if(isset($pm[$typeclass[$v]['classid']]))
-					    {
-							if(stripos($typeclass[$v]['zh'],'|') !== false)
-							{
-								$tz = explode('|',$typeclass[$v]['zh']);
-								$pm[$typeclass[$v]['classid']] = $tz[0];
-							}
-							else
-							{
-						        $pm[$typeclass[$v]['classid']] = $typeclass[$v]['zh'];
-							}
-					    }
-						if(isset($jm[$typeclass[$v]['classid']]))
-						{
-						       $jm[$typeclass[$v]['classid']] = $typeclass[$v]['jm'];
+				// $features = str_replace(array('-163-','-164-','-165-','-166-'),'-',$value['features']);
+			    // $features = explode('-',trim($features,'-'));
+				// $rows[$key]['dbcontent'] = $typeclass[$features[0]]['title'];
+				// $pm = $classid;
+				// $jm = $classid;
+				// foreach($features as $k=>$v)
+				// {
+				// 	if(isset($typeclass[$v]) && isset($bmpx[$typeclass[$v]['classid']]))
+				// 	{
+				// 		if($typeclass[$v]['bm'] != '')
+				// 		{
+				// 		    $bmpx[$typeclass[$v]['classid']] = $typeclass[$v]['bm'];
+				// 		}
+				// 	}
+				// 	if($v != 0)
+				// 	{
+				// 		if(!isset($typeclass[$v]))
+				// 	    {
+				// 			continue;
+				// 	    }
+				// 	    		if(isset($pm[$typeclass[$v]['classid']]))
+				// 	    {
+				// 			if(stripos($typeclass[$v]['zh'],'|') !== false)
+				// 			{
+				// 				$tz = explode('|',$typeclass[$v]['zh']);
+				// 				$pm[$typeclass[$v]['classid']] = $tz[0];
+				// 			}
+				// 			else
+				// 			{
+				// 		        $pm[$typeclass[$v]['classid']] = $typeclass[$v]['zh'];
+				// 			}
+				// 	    }
+				// 		if(isset($jm[$typeclass[$v]['classid']]))
+				// 		{
+				// 		       $jm[$typeclass[$v]['classid']] = $typeclass[$v]['jm'];
 							
-						}
-				    }
-			    }
-				$jm = array_filter($jm);
-				$rows[$key]['bs'] = implode("-",$jm);
-				$rows[$key]['cs'] = $bm.implode("",$bmpx);
-				$zh = implode(" ",$pm);
-				$zh = str_replace('自然色 ','',trim($zh,' '));
-				$zh = str_replace(array('        ','       ','      ','     ','    ','   ','  '),' ',$zh);
-				$zh = preg_replace("/\r\n|\r|\n/",'',$zh);
-				$rows[$key]['features'] = $zh;
+				// 		}
+				//     }
+			    // }
+				// $jm = array_filter($jm);
+				// $rows[$key]['bs'] = implode("-",$jm);
+				// $rows[$key]['cs'] = $bm.implode("",$bmpx);
+				// $zh = implode(" ",$pm);
+				// $zh = str_replace('自然色 ','',trim($zh,' '));
+				// $zh = str_replace(array('        ','       ','      ','     ','    ','   ','  '),' ',$zh);
+				// $zh = preg_replace("/\r\n|\r|\n/",'',$zh);
+				// $rows[$key]['features'] = $zh;
 				
 		    }
+			$list  = $this->logic_whlabel->dataTran($rows,['pm','weight']);
+			
+			$final_list = [];
+			foreach($list as $k=>$v){
+				$final_list[] = [
+					"warehouse"=>$v["warehouse"],
+					"purchase"=>$v["purchase"],
+					"details"=>$v["details"],
+					"cpid"=>$v["cpid"],
+					"dbcontent"=>$v["dbcontent"],
+					"sku"=>$v["sku"],
+					"cs"=>$v["bm"],
+					"bs"=>$v["jm"],
+					"title"=>$v["title"],
+					"features"=>$v["pm"],
+					"cpbz"=>$v["cpbz"],
+					"sm"=>$v["sm"],
+					"type"=>$v["type"],
+					"number"=>$v["number"],
+					"c"=>$v["c"],
+					"x"=>$v["x"],
+					"t"=>$v["t"],
+					"s"=>$v["s"],
+					"q"=>$v["q"],
+					"z"=>$v["z"],
+					"weight"=>$v['weight'],
+				];
+			}
             $title = "总进销存统计表"; 
             $titlename = "<table border=1>
             <tr><th colspan='20' align='center'><h3>".$title."<h3></th></tr>
@@ -3935,11 +3963,12 @@ class Whlabel extends Start_Controller {
 			<td>删除数量</td>
 			<td>其它操作</td>
 			<td>占单数量</td>
+			<td>重量</td>
             </tr>
             </table>";
             $filename = $title.".xls";
 			$tail = "";
-            $this->excel->get_fz2($rows,$titlename,$filename,$tail);
+            $this->excel->get_fz2($final_list,$titlename,$filename,$tail);
 	    }
 	}
 	//入库导出