$data = [[‘订单编号‘, ‘服务类目‘, ‘服务类型‘, ‘商品名称‘, ‘商品型号‘, ‘特殊要求‘, ‘客户姓名‘, ‘手机号码‘, ‘客户地址‘, ‘是否到货‘, ‘物流公司‘, ‘物流单号‘, ‘提货地址‘, ‘提货电话‘ , ‘代付运费‘, ‘下单人‘, ‘联系电话‘],];$i = 0;foreach ($tasks as $key => $value) { $data[$i + 1] = [$value[‘task_sn‘], $value[‘serve_type_name‘], $value[‘serve_category_name‘], $value[‘product_name‘], $value[‘p_type‘], $value[‘desc‘], $value[‘customer_name‘], $value[‘customer_phone‘], $value[‘province_name‘] . $value[‘city_name‘] . $value[‘area_name‘] . $value[‘task_customer‘][‘customer_address‘] , $value[‘is_on_name‘], $value[‘info_company‘], $value[‘info_number‘], $value[‘info_address‘], $value[‘info_phone‘], $value[‘info_price‘], $value[‘employ_user‘][‘realname‘], $value[‘employ_user‘][‘mobile‘]]; $i++;}Excel::create(‘导出账单数据‘, function ($excel) use ($data) { $excel->sheet(‘model‘, function ($sheet) use ($data) { $sheet->rows($data); });})->export(‘csv‘);
时间: 2024-10-18 01:27:07