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
572c31c8
authored
Jan 10, 2023
by
SUDPTDUBLXEROFX\Administrator
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
添加自定义标签
parent
c73d8f29
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
14 deletions
conf/dev/database.ini
service/service_tags.go
conf/dev/database.ini
View file @
572c31c8
...
...
@@ -5,7 +5,7 @@ ShowSQL = false
[spu]
user_name
=
spu
password
=
spu
host
=
192.168.1.23
4
host
=
192.168.1.23
8
database
=
liexin_spu
table_prefix
=
lie_
type
=
mysql
...
...
@@ -13,7 +13,7 @@ type = mysql
[liexin_data]
user_name
=
spu
password
=
spu
host
=
192.168.1.23
4
host
=
192.168.1.23
8
database
=
liexin_data
table_prefix
=
lie_
type
=
mysql
...
...
@@ -39,7 +39,7 @@ type = mysql
[sku0]
user_name
=
spu
password
=
spu
host
=
192.168.1.23
4
host
=
192.168.1.23
8
database
=
liexin_sku_0
table_prefix
=
lie_
type
=
mysql
...
...
@@ -47,7 +47,7 @@ type = mysql
[sku_0]
user_name
=
spu
password
=
spu
host
=
192.168.1.23
4
host
=
192.168.1.23
8
database
=
liexin_sku_0
table_prefix
=
lie_
type
=
mysql
...
...
@@ -55,7 +55,7 @@ type = mysql
[sku_1]
user_name
=
spu
password
=
spu
host
=
192.168.1.23
4
host
=
192.168.1.23
8
database
=
liexin_sku_1
table_prefix
=
lie_
type
=
mysql
...
...
@@ -63,7 +63,7 @@ type = mysql
[sku_2]
user_name
=
spu
password
=
spu
host
=
192.168.1.23
4
host
=
192.168.1.23
8
database
=
liexin_sku_2
table_prefix
=
lie_
type
=
mysql
...
...
@@ -71,7 +71,7 @@ type = mysql
[sku_3]
user_name
=
spu
password
=
spu
host
=
192.168.1.23
4
host
=
192.168.1.23
8
database
=
liexin_sku_3
table_prefix
=
lie_
type
=
mysql
...
...
@@ -79,7 +79,7 @@ type = mysql
[sku_4]
user_name
=
spu
password
=
spu
host
=
192.168.1.23
4
host
=
192.168.1.23
8
database
=
liexin_sku_4
table_prefix
=
lie_
type
=
mysql
...
...
@@ -87,7 +87,7 @@ type = mysql
[sku_5]
user_name
=
spu
password
=
spu
host
=
192.168.1.23
4
host
=
192.168.1.23
8
database
=
liexin_sku_5
table_prefix
=
lie_
type
=
mysql
...
...
@@ -95,7 +95,7 @@ type = mysql
[sku_6]
user_name
=
spu
password
=
spu
host
=
192.168.1.23
4
host
=
192.168.1.23
8
database
=
liexin_sku_6
table_prefix
=
lie_
type
=
mysql
...
...
@@ -103,7 +103,7 @@ type = mysql
[sku_7]
user_name
=
spu
password
=
spu
host
=
192.168.1.23
4
host
=
192.168.1.23
8
database
=
liexin_sku_7
table_prefix
=
lie_
type
=
mysql
...
...
@@ -111,7 +111,7 @@ type = mysql
[sku_8]
user_name
=
spu
password
=
spu
host
=
192.168.1.23
4
host
=
192.168.1.23
8
database
=
liexin_sku_8
table_prefix
=
lie_
type
=
mysql
...
...
@@ -119,7 +119,7 @@ type = mysql
[sku_9]
user_name
=
spu
password
=
spu
host
=
192.168.1.23
4
host
=
192.168.1.23
8
database
=
liexin_sku_9
table_prefix
=
lie_
type
=
mysql
...
...
service/service_tags.go
View file @
572c31c8
...
...
@@ -18,7 +18,7 @@ type TagsService struct {
const
TagZiyingSku
=
4
//获取Spu的属性
func
(
ts
*
TagsService
)
GetTags
(
skuId
string
,
self_supplier_type
int64
)
(
goodsTags
model
.
GoodsTag
)
{
func
(
ts
*
TagsService
)
GetTags
(
skuId
string
,
self_supplier_type
int64
)
(
goodsTags
model
.
GoodsTag
)
{
redisCon
:=
gredis
.
Conn
(
"default_r"
)
defer
redisCon
.
Close
()
goodsTagsStr
,
_
:=
redis
.
String
(
redisCon
.
Do
(
"HGET"
,
"goods_tag"
,
skuId
))
...
...
@@ -39,6 +39,15 @@ func (ts *TagsService) GetTags(skuId string,self_supplier_type int64) (goodsTags
tagNames
=
append
(
tagNames
,
tagName
)
tags
=
append
(
tags
,
int
(
tagResult
.
Int
()))
}
//todo hcy 2023.1.10 增加额外商品标签
customerTag
:=
gjson
.
Get
(
goodsTagsStr
,
"customer_tag"
)
.
String
()
if
customerTag
!=
""
{
customerTagArr
:=
php2go
.
Explode
(
" "
,
php2go
.
Trim
(
customerTag
))
for
_
,
cname
:=
range
customerTagArr
{
tagNames
=
append
(
tagNames
,
cname
)
}
}
}
//如果是自营商品Id,就写死当天发货标签
if
len
(
skuId
)
<
10
&&
self_supplier_type
==
1
{
...
...
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