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
4291b2f8
authored
Aug 16, 2021
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix
parent
545f3731
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
service/service_tags.go
service/service_tags.go
View file @
4291b2f8
...
...
@@ -22,6 +22,9 @@ func (ts *TagsService) GetTags(skuId string) (goodsTags model.GoodsTag) {
redisCon
:=
gredis
.
Conn
(
"default_r"
)
goodsTagsStr
,
_
:=
redis
.
String
(
redisCon
.
Do
(
"HGET"
,
"goods_tag"
,
skuId
))
goodsLabel
:=
""
//goods_tag
var
tags
[]
int
var
tagNames
[]
string
if
goodsTagsStr
!=
""
{
//goods_label
goodsLabelType
:=
int
(
gjson
.
Get
(
goodsTagsStr
,
"goods_label"
)
.
Int
())
...
...
@@ -30,23 +33,20 @@ func (ts *TagsService) GetTags(skuId string) (goodsTags model.GoodsTag) {
goodsTags
.
GoodsLabelName
=
goodsLabel
goodsTags
.
GoodsLabel
=
goodsLabelType
//goods_tag
var
tags
[]
int
var
tagNames
[]
string
for
_
,
tagResult
:=
range
gjson
.
Get
(
goodsTagsStr
,
"tags"
)
.
Array
()
{
tagName
:=
vars
.
GoodsTags
[
int
(
tagResult
.
Int
())]
tagNames
=
append
(
tagNames
,
tagName
)
tags
=
append
(
tags
,
int
(
tagResult
.
Int
()))
}
//如果是自营商品Id,就写死当天发货标签
if
len
(
skuId
)
>
10
{
if
!
php2go
.
InArray
(
TagZiyingSku
,
tags
)
{
tags
=
append
(
tags
,
TagZiyingSku
)
tagNames
=
append
(
tagNames
,
vars
.
GoodsTags
[
TagZiyingSku
]
)
}
}
//如果是自营商品Id,就写死当天发货标签
if
len
(
skuId
)
<
10
{
if
!
php2go
.
InArray
(
TagZiyingSku
,
tags
)
{
tags
=
append
(
tags
,
TagZiyingSku
)
tagNames
=
append
(
tagNames
,
vars
.
GoodsTags
[
TagZiyingSku
])
}
goodsTags
.
GoodsTagNames
=
tagNames
goodsTags
.
GoodsTag
=
tags
}
goodsTags
.
GoodsTagNames
=
tagNames
goodsTags
.
GoodsTag
=
tags
return
goodsTags
}
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