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
0c3c6e1e
authored
Apr 23, 2023
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
导出供应商
parent
a25e54ac
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
2 deletions
app/Console/Commands/SetSupplierFollowUp.php
app/Http/Services/DataService.php
app/Http/routes.php
app/Console/Commands/SetSupplierFollowUp.php
View file @
0c3c6e1e
...
@@ -38,7 +38,7 @@ class SetSupplierFollowUp extends Command
...
@@ -38,7 +38,7 @@ class SetSupplierFollowUp extends Command
// $service->importSupplierGroup(true);
// $service->importSupplierGroup(true);
// $service->changeSupplierType();
// $service->changeSupplierType();
// $service->generateYunxinAccount(true);
// $service->generateYunxinAccount(true);
$service
->
exportSupplier
ForUnionData
();
$service
->
exportSupplier
();
// $service->makeSupplierSystemTagAbnormal();
// $service->makeSupplierSystemTagAbnormal();
}
}
}
}
app/Http/Services/DataService.php
View file @
0c3c6e1e
...
@@ -917,4 +917,51 @@ class DataService
...
@@ -917,4 +917,51 @@ class DataService
})
->
store
(
'xlsx'
);
})
->
store
(
'xlsx'
);
}
}
//导出供应商
public
function
exportSupplier
()
{
ini_set
(
'memory_limit'
,
-
1
);
$excelData
=
[];
$header
=
[
'供应商编码'
,
'供应商名称'
,
'供应商性质'
,
'采购员'
,
'sku采购员'
,
'最新修改人'
,
'创建人'
,
'创建时间'
,
'首次上传sku时间'
,
];
$map
=
[
'source_type'
=>
'all'
,
'uploaded_sku'
=>
-
1
,
'is_export'
=>
1
,
'is_type'
=>
0
,
];
$suppliers
=
(
new
SupplierService
())
->
getSupplierList
(
$map
);
$transformer
=
new
SupplierTransformer
();
$suppliers
=
$transformer
->
transformList
(
$suppliers
);
foreach
(
$suppliers
as
$supplier
)
{
$itemData
=
[
$supplier
[
'supplier_code'
],
$supplier
[
'supplier_name'
],
$supplier
[
'supplier_group'
],
$supplier
[
'channel_username'
],
$supplier
[
'yunxin_channel_username'
],
$supplier
[
'last_update_name'
],
$supplier
[
'create_name'
],
$supplier
[
'create_time'
],
$supplier
[
'first_upload_sku_time'
],
];
$excelData
[]
=
$itemData
;
}
array_unshift
(
$excelData
,
$header
);
Excel
::
create
(
'供应商导出_2023423'
,
function
(
$excel
)
use
(
$excelData
)
{
$excel
->
sheet
(
'sheet1'
,
function
(
$sheet
)
use
(
$excelData
)
{
$sheet
->
fromArray
(
$excelData
);
});
})
->
store
(
'csv'
);
}
}
}
\ No newline at end of file
app/Http/routes.php
View file @
0c3c6e1e
...
@@ -63,5 +63,5 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
...
@@ -63,5 +63,5 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
});
});
Route
::
match
([
'get'
,
'post'
],
'/test'
,
function
()
{
Route
::
match
([
'get'
,
'post'
],
'/test'
,
function
()
{
(
new
\App\Http\Services\DataService
())
->
exportSupplier
ForUnionData
();
(
new
\App\Http\Services\DataService
())
->
exportSupplier
();
});
});
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