|
@@ -242,12 +242,12 @@ class Orders extends Auth{
|
|
|
$orderList[$value['weizan_orderid']]['custom'] = ['phone'=>$value['contact_phone'],'username'=>$value['buyer_nick']];
|
|
|
// 组合成订单的收件地址
|
|
|
$orderList[$value['weizan_orderid']]['contact'] = [
|
|
|
- 'contact_name'=>$value['contact_name'],
|
|
|
- 'contact_phone'=>$value['contact_phone'],
|
|
|
- 'contact_province'=>$value['contact_province'],
|
|
|
- 'contact_city'=>$value['contact_city'],
|
|
|
- 'contact_area'=>$value['contact_area'],
|
|
|
- 'contact_addr'=>$value['contact_addr']
|
|
|
+ 'contact_name'=>trim($value['contact_name']),
|
|
|
+ 'contact_phone'=>trim($value['contact_phone']),
|
|
|
+ 'contact_province'=>trim($value['contact_province']),
|
|
|
+ 'contact_city'=>trim($value['contact_city']),
|
|
|
+ 'contact_area'=>trim($value['contact_area']),
|
|
|
+ 'contact_addr'=>trim($value['contact_addr'])
|
|
|
];
|
|
|
|
|
|
// 组合成订单的收件地址
|
|
@@ -463,41 +463,21 @@ class Orders extends Auth{
|
|
|
// 从第二行写入
|
|
|
$row = 2;
|
|
|
// 循环写入
|
|
|
- foreach ($data as $key => $value) {
|
|
|
- // 如果有多个商品
|
|
|
- $count = count($value['product']);
|
|
|
- // 如果有多个商品
|
|
|
- if( $count > 1 ) {
|
|
|
- // 合并单元格
|
|
|
- $sheet->mergeCells('A'.$row.':'.'A'.($row+$count-1));
|
|
|
- $sheet->mergeCells('B'.$row.':'.'B'.($row+$count-1));
|
|
|
- $sheet->mergeCells('C'.$row.':'.'C'.($row+$count-1));
|
|
|
- $sheet->mergeCells('D'.$row.':'.'D'.($row+$count-1));
|
|
|
- $sheet->mergeCells('E'.$row.':'.'E'.($row+$count-1));
|
|
|
- $sheet->mergeCells('F'.$row.':'.'F'.($row+$count-1));
|
|
|
- $sheet->mergeCells('G'.$row.':'.'G'.($row+$count-1));
|
|
|
- $sheet->mergeCells('H'.$row.':'.'H'.($row+$count-1));
|
|
|
- $sheet->mergeCells('I'.$row.':'.'I'.($row+$count-1));
|
|
|
- $sheet->mergeCells('J'.$row.':'.'J'.($row+$count-1));
|
|
|
- $sheet->mergeCells('R'.$row.':'.'R'.($row+$count-1));
|
|
|
- $sheet->mergeCells('S'.$row.':'.'S'.($row+$count-1));
|
|
|
- }
|
|
|
- // 单元格内容写入
|
|
|
- $sheet->setCellValue('A'.$row, $value['order_id']);
|
|
|
- $sheet->setCellValue('B'.$row, $value['custom_uid']);
|
|
|
- //避免 = + - 识别成公式
|
|
|
- $sheet->setCellValueExplicit('C'.$row, $value['custom_name'],DataType::TYPE_STRING);
|
|
|
- $sheet->setCellValue('D'.$row, $value['status']);
|
|
|
- $sheet->setCellValue('E'.$row, $value['contact_name']);
|
|
|
- $sheet->setCellValue('F'.$row, $value['contact_phone']);
|
|
|
- $sheet->setCellValue('G'.$row, $value['contact_province']);
|
|
|
- $sheet->setCellValue('H'.$row, $value['contact_city']);
|
|
|
- $sheet->setCellValue('I'.$row, $value['contact_area']);
|
|
|
- $sheet->setCellValue('J'.$row, $value['contact_addr']);
|
|
|
- $sheet->setCellValue('S'.$row, $value['weiban_extid']);
|
|
|
- $sheet->setCellValue('T'.$row, date('Y-m-d H:i:s',$value['insert_time']));
|
|
|
+ foreach ($data as $value) {
|
|
|
// 循环产品
|
|
|
foreach ($value['product'] as $v) {
|
|
|
+ // 单元格内容写入
|
|
|
+ $sheet->setCellValue('A'.$row, $value['order_id']);
|
|
|
+ $sheet->setCellValue('B'.$row, $value['custom_uid']);
|
|
|
+ //避免 = + - 识别成公式
|
|
|
+ $sheet->setCellValueExplicit('C'.$row, $value['custom_name'],DataType::TYPE_STRING);
|
|
|
+ $sheet->setCellValue('D'.$row, $value['status']);
|
|
|
+ $sheet->setCellValue('E'.$row, $value['contact_name']);
|
|
|
+ $sheet->setCellValue('F'.$row, $value['contact_phone']);
|
|
|
+ $sheet->setCellValue('G'.$row, $value['contact_province']);
|
|
|
+ $sheet->setCellValue('H'.$row, $value['contact_city']);
|
|
|
+ $sheet->setCellValue('I'.$row, $value['contact_area']);
|
|
|
+ $sheet->setCellValue('J'.$row, $value['contact_addr']);
|
|
|
$sheet->setCellValue('K'.$row, $v['product_id']);
|
|
|
$sheet->setCellValue('L'.$row, $v['product_name']);
|
|
|
$sheet->setCellValue('M'.$row, $v['product_spec']);
|
|
@@ -506,11 +486,12 @@ class Orders extends Auth{
|
|
|
$sheet->setCellValue('P'.$row, $v['buy_num']);
|
|
|
$sheet->setCellValue('Q'.$row, $v['coupon_total']);
|
|
|
$sheet->setCellValue('R'.$row, $v['pay_total']);
|
|
|
+ $sheet->setCellValue('S'.$row, $value['weiban_extid']);
|
|
|
+ $sheet->setCellValue('T'.$row, date('Y-m-d H:i:s',$value['insert_time']));
|
|
|
// 函数自增
|
|
|
$row++;
|
|
|
}
|
|
|
}
|
|
|
- //
|
|
|
// 创建内容
|
|
|
$writer = IOFactory::createWriter($spreadsheet, 'Xlsx');
|
|
|
header('Pragma: public');
|