Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄成意
/
go_sku_server
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
89afc6c1
authored
Jul 23, 2025
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
去重
parent
e011e0ac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletions
service/service_tags.go
service/service_tags.go
View file @
89afc6c1
...
...
@@ -115,8 +115,21 @@ func (ts *TagsService) GetLyTags(sku model.LySku) (goodsTags model.GoodsTag) {
tagNames
=
append
(
tagNames
,
tag
.
String
())
}
}
//去重tagNames
tagNames
=
removeDuplicateString
(
tagNames
)
goodsTags
.
GoodsTagNames
=
tagNames
goodsTags
.
GoodsTag
=
tags
return
goodsTags
}
func
removeDuplicateString
(
s
[]
string
)
[]
string
{
result
:=
[]
string
{}
temp
:=
map
[
string
]
struct
{}{}
for
_
,
item
:=
range
s
{
if
_
,
ok
:=
temp
[
item
];
!
ok
{
temp
[
item
]
=
struct
{}{}
result
=
append
(
result
,
item
)
}
}
return
result
}
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