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
7f61b493
authored
Jul 23, 2025
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'ysx-商品标签需求-20250723' into dev
parents
74b06bad
89afc6c1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
service/service_tags.go
service/service_tags.go
View file @
7f61b493
...
...
@@ -98,7 +98,38 @@ func (ts *TagsService) GetLyTags(sku model.LySku) (goodsTags model.GoodsTag) {
}
}
//还要判断source的标签
sourceTagsStr
,
_
:=
redis
.
String
(
redisCon
.
Do
(
"HGET"
,
"goods_source_tags"
,
sku
.
Source
))
if
sourceTagsStr
!=
""
{
systemTags
:=
gjson
.
Get
(
sourceTagsStr
,
"system_tags"
)
.
Array
()
for
_
,
tag
:=
range
systemTags
{
tagNames
=
append
(
tagNames
,
tag
.
String
())
}
}
//判断goods_label的标签
labelTagsStr
,
_
:=
redis
.
String
(
redisCon
.
Do
(
"HGET"
,
"goods_label_tags"
,
sku
.
GoodsTag
.
GoodsLabel
))
if
labelTagsStr
!=
""
{
labelTags
:=
gjson
.
Get
(
labelTagsStr
,
"system_tags"
)
.
Array
()
for
_
,
tag
:=
range
labelTags
{
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