lvhao hai 5 meses
pai
achega
6ecfe269cf
Modificáronse 1 ficheiros con 58 adicións e 11 borrados
  1. 58 11
      core/CoreApp/controllers/Bosstest.php

+ 58 - 11
core/CoreApp/controllers/Bosstest.php

@@ -1,5 +1,5 @@
 <?php defined('BASEPATH') OR exit('No direct script access allowed');
 <?php defined('BASEPATH') OR exit('No direct script access allowed');
-class Bosstest extends Start_Controller {
+class Boss extends Start_Controller {
 	public function __construct(){
 	public function __construct(){
 		parent::__construct();
 		parent::__construct();
 		$this->load->library('session');
 		$this->load->library('session');
@@ -1123,6 +1123,8 @@ class Bosstest extends Start_Controller {
 			$sp = array();$cs = array();
 			$sp = array();$cs = array();
 			$warehouses = $this->warehouse->find_all('1=1','id,title');
 			$warehouses = $this->warehouse->find_all('1=1','id,title');
 	        $warehouses = array_column($warehouses,'title','id');
 	        $warehouses = array_column($warehouses,'title','id');
+			
+
 			foreach ($data as $val) 
 			foreach ($data as $val) 
 			{
 			{
 				$f = explode(';',trim($val['fpdata'],';'));
 				$f = explode(';',trim($val['fpdata'],';'));
@@ -1180,6 +1182,7 @@ class Bosstest extends Start_Controller {
             		}
             		}
 					$title = explode('|',$v);
 					$title = explode('|',$v);
 					$fg = str_replace(array('-163-','-164-','-165-','-166-','-0-','-126-','-127-','-128-','-197-','-195-'),'-',$title[0]);
 					$fg = str_replace(array('-163-','-164-','-165-','-166-','-0-','-126-','-127-','-128-','-197-','-195-'),'-',$title[0]);
+					$tmp_c = $this->getCate($title[0]);
 					$fg = explode(',',$fg);
 					$fg = explode(',',$fg);
 					//$fg = explode('-',trim($fg[1].$fg[0],'-'));
 					//$fg = explode('-',trim($fg[1].$fg[0],'-'));
 					if(isset($fg[1])){
 					if(isset($fg[1])){
@@ -1261,7 +1264,7 @@ class Bosstest extends Start_Controller {
 							$wh = explode('-',$w[$k]);
 							$wh = explode('-',$w[$k]);
 							$wsku = $this->whlabel->find_all("number = '".$wh[0]."' and sku != 'Preset'");
 							$wsku = $this->whlabel->find_all("number = '".$wh[0]."' and sku != 'Preset'");
 							$whs = (isset($wsku[0]['sku']))?$wsku[0]['sku']:'';
 							$whs = (isset($wsku[0]['sku']))?$wsku[0]['sku']:'';
-							$sp[$title[1]] = array('t'=>$title[1],'z'=>$zh,'w'=>$whs,'j'=>$jm,'n'=>$title[2],"warehouse"=>[
+							$sp[$title[1]] = array('t'=>$title[1],'z'=>$zh,'c'=>$tmp_c,'w'=>$whs,'j'=>$jm,'n'=>$title[2],"warehouse"=>[
 							        $val['type'] =>$title[2],
 							        $val['type'] =>$title[2],
 							    ],"warehouse_show"=>"","xcc"=>0,"mc"=>0,"dzc"=>0,"qtc"=>0);
 							    ],"warehouse_show"=>"","xcc"=>0,"mc"=>0,"dzc"=>0,"qtc"=>0);
 							//美仓
 							//美仓
@@ -1279,11 +1282,12 @@ class Bosstest extends Start_Controller {
 				}
 				}
 			}
 			}
 			foreach ($sp as $k =>$v){
 			foreach ($sp as $k =>$v){
-			    foreach($sp[$k]['warehouse'] as $kk =>$vv){
-			        $warehouse_name = isset($warehouses[$kk])?$warehouses[$kk]:"异常仓库-".$kk;
-			        $sp[$k]['warehouse_show'] .=$warehouse_name.":".$vv."<br />";
-			    }
+			    // foreach($sp[$k]['warehouse'] as $kk =>$vv){
+			    //     $warehouse_name = isset($warehouses[$kk])?$warehouses[$kk]:"异常仓库-".$kk;
+			    //     $sp[$k]['warehouse_show'] .=$warehouse_name.":".$vv."<br />";
+			    // }
 			    unset($sp[$k]['warehouse']);
 			    unset($sp[$k]['warehouse']);
+				unset($sp[$k]['warehouse_show']);
 			}
 			}
 			$sp = array_values($sp);
 			$sp = array_values($sp);
 			$title = "商品统计".date('Y-m-d H-i-s',time()); 
 			$title = "商品统计".date('Y-m-d H-i-s',time()); 
@@ -1291,14 +1295,14 @@ class Bosstest extends Start_Controller {
             <tr>
             <tr>
             <td>名称</td>
             <td>名称</td>
 			<td>中文</td>
 			<td>中文</td>
+			<td>类型</td>
 			<td>SKU</td>
 			<td>SKU</td>
 			<td>用友料号</td>
 			<td>用友料号</td>
             <td>数量</td>
             <td>数量</td>
-			<td>仓库</td>
-			<td>许昌仓订单销售发货量</td>
-			<td>美仓订单发货量</td>
-			<td>定制仓订单发货量</td>
-			<td>其他仓订单发货量</td>
+			<td>许昌仓发货量</td>
+			<td>美仓发货量</td>
+			<td>定制仓发货量</td>
+			<td>其他仓发货量</td>
             </tr>
             </tr>
             </table>"; 
             </table>"; 
             $filename = $title.".xls"; 
             $filename = $title.".xls"; 
@@ -1306,6 +1310,49 @@ class Bosstest extends Start_Controller {
             $this->excel->get_fz2($sp,$titlename,$filename,$tail);
             $this->excel->get_fz2($sp,$titlename,$filename,$tail);
 		}
 		}
 	}
 	}
+
+	public function getCate($str){
+		//就是为了匹配类型的导出的一个定义数组
+		$lx_list = [
+			"126"=>"Hair Weaving - 发条",
+			"127"=>"Closure - 发块前头",
+			"128"=>"Wigs",
+			"130"=>"Hair Extension - 接发",
+			"131"=>"Gift - 礼物",
+			"133"=>"Accessories - 配件",
+			"1297"=>"Synthetic Wig - 化纤头套",
+			"1702"=>"Synthetic Hair - 化纤其它",
+		];
+		
+		if(stripos($str,'-126-') !== false){
+			$tmp_c = "Hair Weaving - 发条";
+		}elseif(stripos($str,'-127-') !== false){
+			$tmp_c = "Closure - 发块前头";
+		}
+		elseif(stripos($str,'-128-') !== false){
+			$tmp_c = "Wigs";
+		}
+		elseif(stripos($str,'-130-') !== false){
+			$tmp_c = "Hair Extension - 接发";
+		}
+		elseif(stripos($str,'-131-') !== false){
+			$tmp_c = "Gift - 礼物";
+		
+		}
+		elseif(stripos($str,'-133-') !== false){
+			$tmp_c = "Accessories - 配件";
+		}
+		elseif(stripos($str,'-1297-') !== false){
+			$tmp_c = "Synthetic Wig - 化纤头套";
+		}
+		elseif(stripos($str,'-1702-') !== false){
+			$tmp_c = "Synthetic Hair - 化纤其它";
+		}
+		else{
+			$tmp_c = "其他";
+		}
+		return $tmp_c;
+	}
 	
 	
 	public function _setting()
 	public function _setting()
 	{
 	{