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
78d33064
authored
Jun 30, 2025
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
打上标签
parent
70482c93
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
8 deletions
service/service_tags.go
service/service_tags.go
View file @
78d33064
package
service
package
service
import
(
import
(
"github.com/gomodule/redigo/redis"
"github.com/syyongx/php2go"
"github.com/tidwall/gjson"
"go_sku_server/model"
"go_sku_server/model"
"go_sku_server/pkg/gredis"
"go_sku_server/pkg/gredis"
"go_sku_server/pkg/vars"
"go_sku_server/pkg/vars"
"github.com/gomodule/redigo/redis"
"github.com/syyongx/php2go"
"github.com/tidwall/gjson"
)
)
//标签相关服务,包括goods_label
//标签相关服务,包括goods_label
...
@@ -14,10 +15,10 @@ import (
...
@@ -14,10 +15,10 @@ import (
type
TagsService
struct
{
type
TagsService
struct
{
}
}
//当天发货标签
//
当天发货标签
const
TagZiyingSku
=
4
const
TagZiyingSku
=
4
//获取Spu的属性
//
获取Spu的属性
func
(
ts
*
TagsService
)
GetTags
(
skuId
string
,
selfSupplierType
int64
)
(
goodsTags
model
.
GoodsTag
)
{
func
(
ts
*
TagsService
)
GetTags
(
skuId
string
,
selfSupplierType
int64
)
(
goodsTags
model
.
GoodsTag
)
{
redisCon
:=
gredis
.
Conn
(
"default_r"
)
redisCon
:=
gredis
.
Conn
(
"default_r"
)
defer
redisCon
.
Close
()
defer
redisCon
.
Close
()
...
@@ -52,13 +53,15 @@ func (ts *TagsService) GetTags(skuId string, selfSupplierType int64) (goodsTags
...
@@ -52,13 +53,15 @@ func (ts *TagsService) GetTags(skuId string, selfSupplierType int64) (goodsTags
goodsTags
.
GoodsLabelName
=
vars
.
GoodsTags
[
TagZiyingSku
]
goodsTags
.
GoodsLabelName
=
vars
.
GoodsTags
[
TagZiyingSku
]
}
}
}
}
tagNames
=
append
(
tagNames
,
"当天发货"
)
goodsTags
.
GoodsTagNames
=
tagNames
goodsTags
.
GoodsTagNames
=
tagNames
goodsTags
.
GoodsTag
=
tags
goodsTags
.
GoodsTag
=
tags
return
goodsTags
return
goodsTags
}
}
// 获取联营tags
//获取联营tags
func
(
ts
*
TagsService
)
GetLyTags
(
sku
model
.
LySku
)
(
goodsTags
model
.
GoodsTag
)
{
func
(
ts
*
TagsService
)
GetLyTags
(
sku
model
.
LySku
)
(
goodsTags
model
.
GoodsTag
)
{
skuId
:=
sku
.
GoodsId
skuId
:=
sku
.
GoodsId
redisCon
:=
gredis
.
Conn
(
"default_r"
)
redisCon
:=
gredis
.
Conn
(
"default_r"
)
...
@@ -83,13 +86,18 @@ func (ts *TagsService) GetLyTags(sku model.LySku) (goodsTags model.GoodsTag) {
...
@@ -83,13 +86,18 @@ func (ts *TagsService) GetLyTags(sku model.LySku) (goodsTags model.GoodsTag) {
for
_
,
cname
:=
range
customerTagArr
{
for
_
,
cname
:=
range
customerTagArr
{
//如果是爱智的话,去掉可议价标签
//如果是爱智的话,去掉可议价标签
if
sku
.
OrgId
==
3
&&
cname
==
"可议价"
{
if
sku
.
OrgId
==
3
&&
cname
==
"可议价"
{
continue
continue
}
}
tagNames
=
append
(
tagNames
,
cname
)
tagNames
=
append
(
tagNames
,
cname
)
}
}
}
}
}
}
if
sku
.
Source
==
12
{
tagNames
=
append
(
tagNames
,
"当天发货"
)
}
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