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())];