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
50a5c0d5
authored
Apr 29, 2021
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix
parent
6cbd7e3e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
app/Http/Services/DataService.php
app/Http/Services/DataService.php
View file @
50a5c0d5
...
@@ -42,7 +42,7 @@ class DataService
...
@@ -42,7 +42,7 @@ class DataService
$names
[]
=
$name
;
$names
[]
=
$name
;
}
}
$names
=
implode
(
'|'
,
$names
);
$names
=
implode
(
'|'
,
$names
);
$result
[]
=
[
'name'
=>
$item
[
'supplier_name'
],
'value'
=>
$names
];
$result
[]
=
[
'name'
=>
'"'
.
$item
[
'supplier_name'
]
.
'"'
,
'value'
=>
$names
,
'code'
=>
$item
[
'supplier_code'
]
];
}
}
// 需要导出的内容
// 需要导出的内容
...
@@ -53,9 +53,9 @@ class DataService
...
@@ -53,9 +53,9 @@ class DataService
// 拼接文件信息,这里注意两点
// 拼接文件信息,这里注意两点
// 1、字段与字段之间用逗号分隔开
// 1、字段与字段之间用逗号分隔开
// 2、行与行之间需要换行符
// 2、行与行之间需要换行符
$fileData
=
$this
->
utfToGbk
(
'姓名, 采购'
)
.
"
\n
"
;
$fileData
=
$this
->
utfToGbk
(
'
编码,
姓名, 采购'
)
.
"
\n
"
;
foreach
(
$result
as
$value
)
{
foreach
(
$result
as
$value
)
{
$temp
=
$value
[
'name'
]
.
','
.
$temp
=
$value
[
'
code'
]
.
','
.
$value
[
'
name'
]
.
','
.
$value
[
'value'
];
$value
[
'value'
];
$fileData
.=
$this
->
utfToGbk
(
$temp
)
.
"
\n
"
;
$fileData
.=
$this
->
utfToGbk
(
$temp
)
.
"
\n
"
;
}
}
...
...
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