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
876aa1ce
authored
Mar 31, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
优化导入脚本
parent
5a04ffca
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
app/Http/Services/DataService.php
app/Http/Services/DataService.php
View file @
876aa1ce
...
@@ -247,12 +247,11 @@ class DataService
...
@@ -247,12 +247,11 @@ class DataService
$channelModel
=
new
SupplierChannelModel
();
$channelModel
=
new
SupplierChannelModel
();
//读取excel
//读取excel
$filePath
=
public_path
(
'data'
)
.
DIRECTORY_SEPARATOR
.
'abnormal_supplier.xlsx'
;
$filePath
=
public_path
(
'data'
)
.
DIRECTORY_SEPARATOR
.
'abnormal_supplier.xlsx'
;
$suppliers
=
[];
try
{
try
{
Excel
::
selectSheetsByIndex
(
0
)
->
load
(
$filePath
,
function
(
$reader
)
{
Excel
::
selectSheetsByIndex
(
0
)
->
load
(
$filePath
,
function
(
$reader
)
{
$reader
->
sheet
(
'QC不良记录'
,
function
()
use
(
$reader
)
{
$reader
->
sheet
(
'QC不良记录'
,
function
()
use
(
$reader
)
{
$supplierModel
=
new
SupplierChannelModel
();
$supplierModel
=
new
SupplierChannelModel
();
dd
(
$reader
->
all
()
->
toArray
())
;
$suppliers
=
[]
;
foreach
(
$reader
->
all
()
->
toArray
()
as
$key
=>
$item
)
{
foreach
(
$reader
->
all
()
->
toArray
()
as
$key
=>
$item
)
{
if
(
$key
==
0
||
$key
==
1
)
{
if
(
$key
==
0
||
$key
==
1
)
{
continue
;
continue
;
...
@@ -271,6 +270,9 @@ class DataService
...
@@ -271,6 +270,9 @@ class DataService
foreach
(
$suppliers
as
$supplier
)
{
foreach
(
$suppliers
as
$supplier
)
{
$supplierId
=
$supplier
[
'supplier_id'
];
$supplierId
=
$supplier
[
'supplier_id'
];
$oldTags
=
$supplier
[
'system_tags'
];
$oldTags
=
$supplier
[
'system_tags'
];
if
(
strpos
(
$supplier
[
'system_tags'
],
'历史检测异常'
)
!==
false
)
{
continue
;
}
$newTags
=
$supplier
[
'system_tags'
]
?
rtrim
(
$supplier
[
'system_tags'
],
$newTags
=
$supplier
[
'system_tags'
]
?
rtrim
(
$supplier
[
'system_tags'
],
','
)
.
',历史检测异常'
:
'历史检测异常'
;
','
)
.
',历史检测异常'
:
'历史检测异常'
;
if
(
$tagService
->
saveTags
(
$supplierId
,
14
,
$newTags
,
$oldTags
))
{
if
(
$tagService
->
saveTags
(
$supplierId
,
14
,
$newTags
,
$oldTags
))
{
...
...
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