Bladeren bron

提交数据

lvhao 3 maanden geleden
bovenliggende
commit
a84f95a8e8
2 gewijzigde bestanden met toevoegingen van 46 en 55 verwijderingen
  1. 44 54
      core/CoreApp/controllers/Fullordertt.php
  2. 2 1
      core/CoreApp/models/Model_excelnew.php

+ 44 - 54
core/CoreApp/controllers/Fullordertt.php

@@ -5711,60 +5711,48 @@ class Fullordertt extends Start_Controller {
 					}
 				}
 
-				// if($excel == '4'){
-				// 	$titlename = "测试";
-				// 	$filename ="ceshi1";
-				// 	$header = [
-				// 		[
-				// 			'title'=>"订单号",
-				// 			'width'=>0,//为0 默认为自动
-				// 		],
-				// 		[
-				// 			'title'=>"订单状态",
-				// 			'width'=>0,//为0 默认为自动
-				// 		],
-				// 		[
-				// 			'title'=>"产品名",
-				// 			'width'=>30,//为0 默认为自动
-				// 		],
-				// 		[
-				// 			'title'=>"客户名",
-				// 			'width'=>0,//为0 默认为自动
-				// 		],
-				// 		[
-				// 			'title'=>"客户邮箱",
-				// 			'width'=>0,//为0 默认为自动
-				// 		],
-				// 		[
-				// 			'title'=>"下单时间",
-				// 			'width'=>0,//为0 默认为自动
-				// 		],
-				// 		[
-				// 			'title'=>"订单金额",
-				// 			'width'=>0,//为0 默认为自动
-				// 		],
-				// 	];
-				// 	$title = $country['zname'].date('Y-m-d',$timetk).'-'.date('Y-m-d',$timetj); 
-				// 	$filename = $title; 
-				// 	$data = $kh;
-				// 	$this->excelnew->doHeadMerg($titlename,$filename,$header,$data);
-				// }else{
-				// 	$title = $country['zname'].date('Y-m-d',$timetk).'-'.date('Y-m-d',$timetj); 
-				// 	$titlename = "<table border=1>
-				// 	<tr>
-				// 	<td>订单号</td>
-				// 	<td>订单状态</td>
-				// 	<td>产品名</td>
-				// 	<td>客户名</td>
-				// 	<td>客户邮箱</td>
-				// 	<td>下单时间</td>
-				// 	<td>订单金额</td>
-				// 	</tr>
-				// 	</table>"; 
-				// 	$filename = $title.".xls"; 
-				// 	$tail = "\n";
-				// 	$this->excel->get_fz2($kh,$titlename,$filename,$tail);
-				// }
+				if($excel == '4'){
+					$header = [
+						[
+							'title'=>"订单号",
+							'width'=>0,//为0 默认为自动
+						],
+						[
+							'title'=>"订单状态",
+							'width'=>0,//为0 默认为自动
+						],
+						[
+							'title'=>"产品名",
+							'width'=>30,//为0 默认为自动
+						],
+						[
+							'title'=>"客户名",
+							'width'=>0,//为0 默认为自动
+						],
+						[
+							'title'=>"客户邮箱",
+							'width'=>0,//为0 默认为自动
+						],
+						[
+							'title'=>"下单时间",
+							'width'=>0,//为0 默认为自动
+						],
+						[
+							'title'=>"订单金额",
+							'width'=>0,//为0 默认为自动
+						],
+					];
+					if(!empty($country['zname'])){
+						$title = $country['zname'].date('Y-m-d',$timetk).'-'.date('Y-m-d',$timetj); 
+					}else{
+						$title = date('Y-m-d',$timetk).'-'.date('Y-m-d',$timetj); 
+					}
+					
+					$filename = $title; 
+					$data = $kh;
+					
+					$this->excelnew->doHeadMerg($title,$filename,$header,$data);
+				}else{
 					$title = $country['zname'].date('Y-m-d',$timetk).'-'.date('Y-m-d',$timetj); 
 					$titlename = "<table border=1>
 					<tr>
@@ -5780,6 +5768,8 @@ class Fullordertt extends Start_Controller {
 					$filename = $title.".xls"; 
 					$tail = "\n";
 					$this->excel->get_fz2($kh,$titlename,$filename,$tail);
+				}
+					
 			}
 		}
 	}

+ 2 - 1
core/CoreApp/models/Model_excelnew.php

@@ -35,8 +35,9 @@ class Model_excelnew extends Lin_Model {
         ];
         $objSheet->getStyle('A1:D1')->applyFromArray($mainHeaderStyle);
         
+        $tmp_title_list = array_column($header,'title');
         // 子表头
-        $objSheet->fromArray($header_title_name, null, 'A2');
+        $objSheet->fromArray($tmp_title_list, null, 'A2');
         
         // 子表头样式
         $subHeaderStyle = [