Commit d5563313 by 杨树贤

导出数据

parent 0ce0036d
......@@ -851,9 +851,11 @@ class DataService
foreach ($suppliersAll as $supplier) {
$createTime = date('Y-m-d H:i:s', $supplier['create_time']);
$creatName = UserInfoModel::where('userId', $supplier['create_uid'])->value('name');
$supplierGroup = array_get(config('fixed.SupplierGroup'),$supplier['supplier_group']);
$data = [
$creatName,
$supplier['supplier_name'],
$supplierGroup,
$createTime,
];
if ($supplier['create_time'] >= 1640966400) {
......@@ -866,21 +868,28 @@ class DataService
if ($supplier['pay_type'] == 1) {
$suppliersZhangQi[] = $data;
}
$suppliersAllList[] = $data;
}
$header = ['创建人', '供应商名称', '创建时间'];
$header = ['创建人', '供应商名称','供应商性质', '创建时间'];
// dd($suppliersZhangQi,$header);
$excel->sheet('2022年创建的供应商', function ($sheet) use ($header, $suppliers2022) {
array_unshift($suppliers2022, $header);
$sheet->fromArray($suppliers2022);
});
$excel->sheet('2022年创建的账期供应商', function ($sheet) use ($header, $suppliersZhangQi2022) {
array_unshift($suppliersZhangQi2022, $header);
$sheet->fromArray($suppliersZhangQi2022);
});
$excel->sheet('全部账期供应商', function ($sheet) use ($header, $suppliersZhangQi) {
array_unshift($suppliersZhangQi, $header);
$sheet->fromArray($suppliersZhangQi);
// $excel->sheet('2022年创建的供应商', function ($sheet) use ($header, $suppliers2022) {
// array_unshift($suppliers2022, $header);
// $sheet->fromArray($suppliers2022);
// });
// $excel->sheet('2022年创建的账期供应商', function ($sheet) use ($header, $suppliersZhangQi2022) {
// array_unshift($suppliersZhangQi2022, $header);
// $sheet->fromArray($suppliersZhangQi2022);
// });
// $excel->sheet('全部账期供应商', function ($sheet) use ($header, $suppliersZhangQi) {
// array_unshift($suppliersZhangQi, $header);
// $sheet->fromArray($suppliersZhangQi);
// });
$excel->sheet('全部供应商', function ($sheet) use ($header, $suppliersAllList) {
array_unshift($suppliersAllList, $header);
$sheet->fromArray($suppliersAllList);
});
})->store('xlsx');
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment