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
ee67b5c3
authored
Feb 01, 2023
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
导出文件名
parent
2f53bf4b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
app/Http/Services/DataService.php
app/Http/Services/DataService.php
View file @
ee67b5c3
...
@@ -832,8 +832,16 @@ class DataService
...
@@ -832,8 +832,16 @@ class DataService
public
static
function
exportSupplierByDepartment
(
$topDepartmentId
)
public
static
function
exportSupplierByDepartment
(
$topDepartmentId
)
{
{
if
(
$topDepartmentId
==
47
)
{
Excel
::
create
(
'采购供应商数据导出'
,
function
(
$excel
)
use
(
$topDepartmentId
)
{
$append
=
'联营一部'
;
}
if
(
$topDepartmentId
==
51
)
{
$append
=
'自营采购部'
;
}
if
(
$topDepartmentId
==
72
)
{
$append
=
'联营二部'
;
}
Excel
::
create
(
'采购供应商数据导出_'
.
$append
,
function
(
$excel
)
use
(
$topDepartmentId
)
{
$departmentIds
=
DepartmentModel
::
where
(
'parent_id'
,
$topDepartmentId
)
->
pluck
(
'department_id'
)
->
toArray
();
$departmentIds
=
DepartmentModel
::
where
(
'parent_id'
,
$topDepartmentId
)
->
pluck
(
'department_id'
)
->
toArray
();
$userIds
=
UserInfoModel
::
whereIn
(
'department_id'
,
$departmentIds
)
->
pluck
(
'userId'
)
->
toArray
();
$userIds
=
UserInfoModel
::
whereIn
(
'department_id'
,
$departmentIds
)
->
pluck
(
'userId'
)
->
toArray
();
$suppliers2022
=
$suppliersZhangQi2022
=
$suppliersAll
=
$suppliersZhangQi
=
[];
$suppliers2022
=
$suppliersZhangQi2022
=
$suppliersAll
=
$suppliersZhangQi
=
[];
...
@@ -848,7 +856,7 @@ class DataService
...
@@ -848,7 +856,7 @@ class DataService
$supplier
[
'supplier_name'
],
$supplier
[
'supplier_name'
],
$createTime
,
$createTime
,
];
];
if
(
$supplier
[
'create_time'
]
>=
1640966400
-
3600
*
24
*
365
)
{
if
(
$supplier
[
'create_time'
]
>=
1640966400
)
{
$suppliers2022
[]
=
$data
;
$suppliers2022
[]
=
$data
;
if
(
$supplier
[
'pay_type'
]
==
1
)
{
if
(
$supplier
[
'pay_type'
]
==
1
)
{
$suppliersZhangQi2022
[]
=
$data
;
$suppliersZhangQi2022
[]
=
$data
;
...
@@ -873,6 +881,6 @@ class DataService
...
@@ -873,6 +881,6 @@ class DataService
array_unshift
(
$suppliersZhangQi
,
$header
);
array_unshift
(
$suppliersZhangQi
,
$header
);
$sheet
->
fromArray
(
$suppliersZhangQi
);
$sheet
->
fromArray
(
$suppliersZhangQi
);
});
});
})
->
export
(
'xls
'
);
})
->
store
(
'xlsx
'
);
}
}
}
}
\ No newline at end of file
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