Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
search_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
caaf69a1
authored
Jul 06, 2020
by
huangchengyi
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1.0
parent
142ff977
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletions
service/common_ly_service.go
service/common_ly_service.go
View file @
caaf69a1
...
...
@@ -20,6 +20,13 @@ var supplier_over_time = map[string]int64{
"buerklin"
:
3600
,
}
//调用当前方法的供应商名称
var
supplier_name
string
=
""
;
//组装批量更新es数据
var
sku_list
[]
map
[
string
]
interface
{}
//redis 相关
var
sku_uique_judge
string
=
config
.
Get
(
"redis_all.SKU_UNIQUE_JUDGE"
)
.
String
()
//sku唯一键
var
spu_uique_judge
string
=
config
.
Get
(
"redis_all.SPU_UNIQUE_JUDGE"
)
.
String
()
//spu唯一键
var
brand_name_all
string
=
config
.
Get
(
"redis_all.BRAND_NAME_ALL"
)
.
String
()
//品牌键
...
...
@@ -37,7 +44,7 @@ func getSkuByGoodsSn(goods_list map[string]*model.LyClearGoodsList,supplier_info
for
goods_sn
,
info
:=
range
goods_list
{
sn_sku
:=
php2go
.
Md5
(
strings
.
ToLower
(
goods_sn
))
sku_id
,
_
:=
gredis
.
HG
et
(
sku_uique_judge
,
sn_sku
)
//查询唯一值,反查sku_id
sku_id
,
_
:=
gredis
.
hg
et
(
sku_uique_judge
,
sn_sku
)
//查询唯一值,反查sku_id
var
sku_flag
bool
=
false
;
//是否新增或者更新db+redis,为true则新增
if
sku_id
==
""
{
//为空,先创建sku
...
...
@@ -131,6 +138,12 @@ func writeBrandInfo(sku_info *model.LyClearGoodsList) {
UpdateTime
:
,
}
}
/*
组装推送到es数据
*/
func
esSkuInfo
(
sku_info
*
model
.
LyClearGoodsList
)
{
}
/*
推入队列
...
...
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