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
1ebc9df0
authored
Jul 29, 2024
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
导出重名供应商
parent
43b95860
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
app/Http/Services/DataService.php
app/Http/routes.php
app/Http/Services/DataService.php
View file @
1ebc9df0
...
@@ -25,6 +25,7 @@ use App\Model\UserInfoModel;
...
@@ -25,6 +25,7 @@ use App\Model\UserInfoModel;
use
Carbon\Carbon
;
use
Carbon\Carbon
;
use
GuzzleHttp\Client
;
use
GuzzleHttp\Client
;
use
GuzzleHttp\RequestOptions
;
use
GuzzleHttp\RequestOptions
;
use
Illuminate\Support\Facades\DB
;
use
Illuminate\Support\Facades\Redis
;
use
Illuminate\Support\Facades\Redis
;
use
Maatwebsite\Excel\Facades\Excel
;
use
Maatwebsite\Excel\Facades\Excel
;
...
@@ -631,4 +632,31 @@ class DataService
...
@@ -631,4 +632,31 @@ class DataService
]);
]);
}
}
public
static
function
exportNameInvalid
()
{
$suppliers
=
DB
::
connection
(
'web'
)
->
select
(
'SELECT *, count(*) FROM lie_supplier_channel WHERE is_type=0 and group_code != "" GROUP BY supplier_name having count(*) > 1'
);
foreach
(
$suppliers
as
$supplier
)
{
}
Excel
::
create
(
'重名供应商导出'
,
function
(
$excel
)
use
(
$suppliers
)
{
$header
=
[
'供应商名字'
,
'供应商编码'
,
'集团编码'
,
];
$excelData
=
[];
foreach
(
$suppliers
as
$supplier
)
{
$excelData
[]
=
[
$supplier
[
'supplier_name'
],
$supplier
[
'supplier_code'
],
$supplier
[
'group_code'
],
];
}
array_unshift
(
$excelData
,
$header
);
$excel
->
sheet
(
'sheet1'
,
function
(
$sheet
)
use
(
$excelData
)
{
$sheet
->
fromArray
(
$excelData
);
});
})
->
export
(
'csv'
);
}
}
}
app/Http/routes.php
View file @
1ebc9df0
...
@@ -84,6 +84,7 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
...
@@ -84,6 +84,7 @@ Route::group(['middleware' => ['external'], 'namespace' => 'Sync'], function ()
});
});
Route
::
match
([
'get'
,
'post'
],
'/test'
,
function
()
{
Route
::
match
([
'get'
,
'post'
],
'/test'
,
function
()
{
\App\Http\Services\DataService
::
exportNameInvalid
();
//\App\Http\Services\SupplierAddressService::initUnitedAddress();
//\App\Http\Services\SupplierAddressService::initUnitedAddress();
//\App\Http\Services\DataService::checkSupplierBandAccount();
//\App\Http\Services\DataService::checkSupplierBandAccount();
//(new CompanyService())->checkSupplierCompanyAndAddress(11042);
//(new CompanyService())->checkSupplierCompanyAndAddress(11042);
...
...
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