Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
liexin_supplier
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d5563313
authored
Feb 09, 2023
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
导出数据
parent
0ce0036d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
12 deletions
app/Http/Services/DataService.php
storage/exports/采购供应商数据导出_自营采购部.xlsx
app/Http/Services/DataService.php
View file @
d5563313
...
...
@@ -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
storage/exports/采购供应商数据导出_自营采购部.xlsx
0 → 100644
View file @
d5563313
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment