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
545f3731
authored
Aug 16, 2021
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
自营写死标签
parent
5138157b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
service/service_tags.go
service/service_tags.go
View file @
545f3731
...
@@ -2,6 +2,7 @@ package service
...
@@ -2,6 +2,7 @@ package service
import
(
import
(
"github.com/gomodule/redigo/redis"
"github.com/gomodule/redigo/redis"
"github.com/syyongx/php2go"
"github.com/tidwall/gjson"
"github.com/tidwall/gjson"
"go_sku_server/model"
"go_sku_server/model"
"go_sku_server/pkg/gredis"
"go_sku_server/pkg/gredis"
...
@@ -13,6 +14,9 @@ import (
...
@@ -13,6 +14,9 @@ import (
type
TagsService
struct
{
type
TagsService
struct
{
}
}
//当天发货标签
const
TagZiyingSku
=
4
//获取Spu的属性
//获取Spu的属性
func
(
ts
*
TagsService
)
GetTags
(
skuId
string
)
(
goodsTags
model
.
GoodsTag
)
{
func
(
ts
*
TagsService
)
GetTags
(
skuId
string
)
(
goodsTags
model
.
GoodsTag
)
{
redisCon
:=
gredis
.
Conn
(
"default_r"
)
redisCon
:=
gredis
.
Conn
(
"default_r"
)
...
@@ -34,6 +38,13 @@ func (ts *TagsService) GetTags(skuId string) (goodsTags model.GoodsTag) {
...
@@ -34,6 +38,13 @@ func (ts *TagsService) GetTags(skuId string) (goodsTags model.GoodsTag) {
tagNames
=
append
(
tagNames
,
tagName
)
tagNames
=
append
(
tagNames
,
tagName
)
tags
=
append
(
tags
,
int
(
tagResult
.
Int
()))
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
])
}
}
goodsTags
.
GoodsTagNames
=
tagNames
goodsTags
.
GoodsTagNames
=
tagNames
goodsTags
.
GoodsTag
=
tags
goodsTags
.
GoodsTag
=
tags
}
}
...
...
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