From 73b874c72ad55eb9eef21c36160ac0de58f0189e Mon Sep 17 00:00:00 2001
From: quanwei <419654421@qq.com>
Date: Thu, 05 Feb 2026 10:30:43 +0800
Subject: [PATCH] 优化名片
---
admin/app/shop/service/order/ExportService.php | 74 +++++++++++++++++++++++++++++++++++++
1 files changed, 74 insertions(+), 0 deletions(-)
diff --git a/admin/app/shop/service/order/ExportService.php b/admin/app/shop/service/order/ExportService.php
index ec07d02..4b4fdb2 100644
--- a/admin/app/shop/service/order/ExportService.php
+++ b/admin/app/shop/service/order/ExportService.php
@@ -181,6 +181,80 @@
}
/**
+ * 运营中心订单导出
+ */
+ public function operationsOrderList($list)
+ {
+ $spreadsheet = new Spreadsheet();
+ $sheet = $spreadsheet->getActiveSheet();
+
+ //列宽
+ $sheet->getColumnDimension('B')->setWidth(30);
+
+ //设置工作表标题名称
+ $sheet->setTitle('运营中心订单明细');
+
+ $sheet->setCellValue('A1', '订单号');
+ $sheet->setCellValue('B1', '商品信息');
+ $sheet->setCellValue('C1', '订单总额');
+ $sheet->setCellValue('D1', '实付款金额');
+ $sheet->setCellValue('E1', '支付方式');
+ $sheet->setCellValue('F1', '下单时间');
+ $sheet->setCellValue('G1', '省级运营中心');
+ $sheet->setCellValue('H1', '省级佣金');
+ $sheet->setCellValue('I1', '市级运营中心');
+ $sheet->setCellValue('J1', '市级佣金');
+ $sheet->setCellValue('K1', '区级运营中心');
+ $sheet->setCellValue('L1', '区级佣金');
+ $sheet->setCellValue('M1', '买家');
+ $sheet->setCellValue('N1', '付款状态');
+ $sheet->setCellValue('O1', '付款时间');
+ $sheet->setCellValue('P1', '发货状态');
+ $sheet->setCellValue('Q1', '发货时间');
+ $sheet->setCellValue('R1', '收货状态');
+ $sheet->setCellValue('S1', '收货时间');
+ $sheet->setCellValue('T1', '订单状态');
+ $sheet->setCellValue('U1', '佣金结算');
+ $sheet->setCellValue('V1', '结算时间');
+ //填充数据
+ $index = 0;
+ foreach ($list as $operations) {
+ $order = $operations['order_master'];
+ $sheet->setCellValue('A' . ($index + 2), "\t" . $order['order_no'] . "\t");
+ $sheet->setCellValue('B' . ($index + 2), $this->filterProductInfo($order));
+ $sheet->setCellValue('C' . ($index + 2), $order['total_price']);
+ $sheet->setCellValue('D' . ($index + 2), $order['pay_price']);
+ $sheet->setCellValue('E' . ($index + 2), $order['pay_type']['text']);
+ $sheet->setCellValue('F' . ($index + 2), $order['create_time']);
+ $sheet->setCellValue('G' . ($index + 2), isset($operations['agent_first'])?$operations['agent_first']['nickName']:'');
+ $sheet->setCellValue('H' . ($index + 2), $operations['first_money']);
+ $sheet->setCellValue('I' . ($index + 2), isset($operations['agent_second'])?$operations['agent_second']['nickName']:'');
+ $sheet->setCellValue('J' . ($index + 2), $operations['second_money']);
+ $sheet->setCellValue('K' . ($index + 2), isset($operations['agent_third'])?$operations['agent_third']['nickName']:'');
+ $sheet->setCellValue('L' . ($index + 2), $operations['third_money']);
+ $sheet->setCellValue('M' . ($index + 2), $order['user']['nickName']);
+ $sheet->setCellValue('N' . ($index + 2), $order['pay_status']['text']);
+ $sheet->setCellValue('O' . ($index + 2), $this->filterTime($order['pay_time']));
+ $sheet->setCellValue('P' . ($index + 2), $order['delivery_status']['text']);
+ $sheet->setCellValue('Q' . ($index + 2), $this->filterTime($order['delivery_time']));
+ $sheet->setCellValue('R' . ($index + 2), $order['receipt_status']['text']);
+ $sheet->setCellValue('S' . ($index + 2), $this->filterTime($order['receipt_time']));
+ $sheet->setCellValue('T' . ($index + 2), $order['order_status']['text']);
+ $sheet->setCellValue('U' . ($index + 2), $operations['is_settled'] == 1 ? '已结算' : '未结算');
+ $sheet->setCellValue('V' . ($index + 2), $this->filterTime($operations['settle_time']));
+ $index++;
+ }
+
+ //保存文件
+ $filename = iconv("UTF-8", "GB2312//IGNORE", '运营中心订单') . '-' . date('YmdHis') . '.xlsx';
+ header('Content-Type: application/vnd.ms-excel');
+ header('Content-Disposition: attachment;filename="' . $filename . '"');
+ header('Cache-Control: max-age=0');
+ $writer = IOFactory::createWriter($spreadsheet, 'Xlsx');
+ $writer->save('php://output');
+ }
+
+ /**
* 提现订单导出
*/
public function cashList($list)
--
Gitblit v1.9.2