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
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 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) {
...
@@ -22,6 +22,9 @@ func (ts *TagsService) GetTags(skuId string) (goodsTags model.GoodsTag) {
redisCon
:=
gredis
.
Conn
(
"default_r"
)
redisCon
:=
gredis
.
Conn
(
"default_r"
)
goodsTagsStr
,
_
:=
redis
.
String
(
redisCon
.
Do
(
"HGET"
,
"goods_tag"
,
skuId
))
goodsTagsStr
,
_
:=
redis
.
String
(
redisCon
.
Do
(
"HGET"
,
"goods_tag"
,
skuId
))
goodsLabel
:=
""
goodsLabel
:=
""
//goods_tag
var
tags
[]
int
var
tagNames
[]
string
if
goodsTagsStr
!=
""
{
if
goodsTagsStr
!=
""
{
//goods_label
//goods_label
goodsLabelType
:=
int
(
gjson
.
Get
(
goodsTagsStr
,
"goods_label"
)
.
Int
())
goodsLabelType
:=
int
(
gjson
.
Get
(
goodsTagsStr
,
"goods_label"
)
.
Int
())
...
@@ -30,16 +33,14 @@ func (ts *TagsService) GetTags(skuId string) (goodsTags model.GoodsTag) {
...
@@ -30,16 +33,14 @@ func (ts *TagsService) GetTags(skuId string) (goodsTags model.GoodsTag) {
goodsTags
.
GoodsLabelName
=
goodsLabel
goodsTags
.
GoodsLabelName
=
goodsLabel
goodsTags
.
GoodsLabel
=
goodsLabelType
goodsTags
.
GoodsLabel
=
goodsLabelType
//goods_tag
var
tags
[]
int
var
tagNames
[]
string
for
_
,
tagResult
:=
range
gjson
.
Get
(
goodsTagsStr
,
"tags"
)
.
Array
()
{
for
_
,
tagResult
:=
range
gjson
.
Get
(
goodsTagsStr
,
"tags"
)
.
Array
()
{
tagName
:=
vars
.
GoodsTags
[
int
(
tagResult
.
Int
())]
tagName
:=
vars
.
GoodsTags
[
int
(
tagResult
.
Int
())]
tagNames
=
append
(
tagNames
,
tagName
)
tagNames
=
append
(
tagNames
,
tagName
)
tags
=
append
(
tags
,
int
(
tagResult
.
Int
()))
tags
=
append
(
tags
,
int
(
tagResult
.
Int
()))
}
}
}
//如果是自营商品Id,就写死当天发货标签
//如果是自营商品Id,就写死当天发货标签
if
len
(
skuId
)
>
10
{
if
len
(
skuId
)
<
10
{
if
!
php2go
.
InArray
(
TagZiyingSku
,
tags
)
{
if
!
php2go
.
InArray
(
TagZiyingSku
,
tags
)
{
tags
=
append
(
tags
,
TagZiyingSku
)
tags
=
append
(
tags
,
TagZiyingSku
)
tagNames
=
append
(
tagNames
,
vars
.
GoodsTags
[
TagZiyingSku
])
tagNames
=
append
(
tagNames
,
vars
.
GoodsTags
[
TagZiyingSku
])
...
@@ -47,6 +48,5 @@ func (ts *TagsService) GetTags(skuId string) (goodsTags model.GoodsTag) {
...
@@ -47,6 +48,5 @@ func (ts *TagsService) GetTags(skuId string) (goodsTags model.GoodsTag) {
}
}
goodsTags
.
GoodsTagNames
=
tagNames
goodsTags
.
GoodsTagNames
=
tagNames
goodsTags
.
GoodsTag
=
tags
goodsTags
.
GoodsTag
=
tags
}
return
goodsTags
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