From f7f1d7c3887d64f3b2c1ed43c3ce7ffed70ac513 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Mon, 11 Mar 2024 10:56:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=8E=E5=8F=B0excel?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/services/ExcelService.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/crmeb/services/ExcelService.php b/crmeb/services/ExcelService.php index 5a153e7d..18e6f7fc 100755 --- a/crmeb/services/ExcelService.php +++ b/crmeb/services/ExcelService.php @@ -122,7 +122,7 @@ class ExcelService */ public function order(array $where, int $page, int $limit) { - $paytype = [0 => '余额', 1 => '微信', 2 => '小程序', 3 => 'H5', 4 => '支付宝', 5 => '支付宝扫码', 6 => '微信扫码',]; + $paytype = [0 => '余额', 1 => '微信', 2 => '小程序', 3 => 'H5', 4 => '支付宝', 5 => '支付宝扫码', 6 => '微信扫码',8=>'信用购-先货后款',9=>'商户余额支付']; $make = app()->make(StoreOrderRepository::class); $status = $where['status']; $del = $where['mer_id'] > 0 ? 0 : null; @@ -140,12 +140,14 @@ class ExcelService $export = []; foreach ($list as $item) { $product = []; + foreach ($item['orderProduct'] as $value) { $product[] = [ - $value['cart_info']['product']['store_name'], + $value['cart_info']['product']['store_name']??'', $value['cart_info']['productAttr']['sku'] ?: '无', - $value['product_num'] . ' ' . $value['unit_name'], - $value['cart_info']['productAttr']['price'] + $value['product_num'] . ' ' . $value['unit_name']??'', + $value['cart_info']['productAttr']['price']??'' + ]; } $one = [ @@ -170,6 +172,8 @@ class ExcelService ]; $export[] = $one; } + + $header = ['商户名称', '订单编号', '订单类型', '推广人', '用户信息', '商品名称', '商品规格', '商品数量', '商品价格', '优惠', '实付邮费(元)', '实付金额(元)', '已退款金额(元)', '收货人', '收货人电话', '收货地址', '物流/电话', '下单时间', '支付方式', '支付状态', '商家备注']; $filename = '订单列表_' . date('YmdHis'); $title = ['订单列表', '导出时间:' . date('Y-m-d H:i:s', time())];